Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin-dir with cols=tags writes/corrupts data/index/topic.idx #6

Open
LukasDrude opened this issue Jun 24, 2012 · 5 comments
Open

Comments

@LukasDrude
Copy link

Versions:

  • Release 2012-01-25a “Angua”
  • lupo49-dokuwiki-plugin-dir-860ca8b.tar.gz
  • dokufreaks-plugin-tag-2010-11-12-30-ga058f92.tar.gz
  • dokufreaks-plugin-pagelist-2010-01-07-18-gfb8719a.tar.gz

I use the Plugin-dir the following way, if I do not use the "tags"-keyword, the error does not occur:
~~DIR?cols=page;tags;mdate~~

Each refresh of the page containing the above statement modifies the file data/index/topic.idx so that it becomes incorrect. For example pages seem to have tags, which they in fact do not have. Some pages are listed twice within one tag.

To visualize this for a human reader, I modified the "topic.idx" with "sed":
cat topic.idx | sed 's/}/\n}\n\n/g' | sed 's/i:/\n i:/g' > topic_nice.idx

I was now able to compare the version after a rebuild with "Tagindex Manager" (here are just parts):

    +s:4:"java";a:8:{
       i:0;s:8:"freemind";
       i:1;s:12:"zettelkasten";
    +  i:2;s:9:":freemind";
    +  i:3;s:27:":gruenes_curry_huehnerbrust";
    +  i:4;s:28:":hackfleisch_gruener_pfeffer";
    +  i:5;s:21:":ingwer_moehren_suppe";
    +  i:6;s:8:":kdialog";
    +  i:7;s:13:":zettelkasten";
     }

As you can see, the pages "freemind" and "zettelkasten" are now added twice (once with colon and once without). Also all other added entries are not related to the tag "java" in any way.

(If you need further information, please let me know. This is my first issue submission and I was not able to understand the source-code without additional comments.)

@lupo49
Copy link
Owner

lupo49 commented Jun 25, 2012

Please change the line 257 in syntax.php to

$html = $plug->td (cleanID($id)) ;

Michitux discovered that the dir plugin passes the page $id's in an uncleaned version (preceded with a colon) to the tag helper functions.

http://dump.lupo49.de/tmp/dokuwiki/dir_plugin_function_call.png

@LukasDrude
Copy link
Author

Thank you for your fast response. Indeed your correction improves the situation. Double entries because of pages added twice (once with colon and once without) do not occur anymore.

Anyhow the file topic.idx is still modified when calling the dir-plugin with the tags-flag. Each call modifies the file a bit (introducing some mistakes) and after several calls (reloading the page), it does not change anymore.

In the short future I will provide an example installation (like a minimal example), which hopefully presents this error.

@lupo49
Copy link
Owner

lupo49 commented Jun 28, 2012

Thats because of how the tag plugin handles the call of td($id). It requests the tag-related metadata of the passed $id which leads in the end to a refresh of your file.

But you are right, pulling the metadata shouldn't modify your file in a strange way. (Of course, the file would be modified in a proper way, when no tag-related metadata exists or it needs a refresh: http://xref.dokuwiki.org/reference/dokuwiki/nav.html?_functions/p_get_metadata.html)

@LukasDrude
Copy link
Author

I was trying to reconstruct the error with a minimal example, but I did not succeed. I will resume, when I managed to reconstruct it.

@michitux
Copy link
Collaborator

In the current version of the tag plugin the tag plugin no longer uses a custom tag index but the DokuWiki metadata index and the code has been changed such that pages don't influence each other anymore when they are listed on the same page. Could you please test if this has also fixed your problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants