Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
If you add tags to a topic, a corresponding file is created inside pub/_work_areas/TagMePlugin (_tags_WEB.TOPIC.txt). When you rename or move a topic, the tags file is correctly renamed. But if you rename or move a web, its tags are not updated.
After that, if you search for a tag that existed inside that web, you get inconsistent results.
--
TWiki:Main/GuilhermeGarnier - 08 Jan 2008
I found a solution for this bug. The plugin has to implement afterRenameHandler to know when a web is renamed/moved.
After implementing this function, I got an error message when trying to rename a web: "Insecure dependency in unlink while running with -T switch at ...". I found
here that -T (taint) is a Perl parameter used to enforce security. When it's used, Perl don't let you call unlink (and other potentially dangerous functions) with parameters got from command line or get/post forms.
The solution I found for that, as recommended on the above link, is to use a regular expression to "untaint" the parameters. It worked, but it doesn't let you have characters other than alphanumerics, "_", "-" and "@" on the parameters. I think that's fine, as it's a topic name, but is there any other character allowed on topic names that isn't listed here? Also I think "@" isn't needed for that, right?
I'm attaching a patch to the current version of the plugin. Please test to see if there is any problem with it.
--
TWiki:Main.GuilhermeGarnier - 09 Jan 2008
As a sidenote: please observe that there are regular expressions defined in TWiki to match web and/or topic names, that you can probably use to untaint properly. See
TWiki.TWikiFuncDotPm#get_RegularExpression_name_expr for more.
--
TWiki:Main.KoenMartens - 24 Apr 2008
Switched back to "New" status, as it was waiting for feedback from Peter Thoeny, which is about as useful as asking a mole for sunbathing advice.
--
CrawfordCurrie - 26 Aug 2010
We are using the current plugin version as of 7/9/2012, and this problem still exists. The attached patch does not seem relevant to the current version. Does anyone have a more recent patch? Does anyone know if/when this problem is being addressed?
I changed status to Confirmed, since I have confirmed that the problem still exists.
--
KenK - 09 Jul 2012
We came across the same problem in our Foswiki these days. Since TagMePlugin
does not seem to be maintained since more than ten years, I've written a Python
script that detects tag files where the corresponding topic file does not exist.
You may download this script and use as necessary.
- License is GPL 3.0 or higher.
- Runs with Python 3 (running with Python 2 might require some small changes).
- Runs under Linux/Unix. Not tested with MacOSX. Under Windows you'd have to replace the subprocess.Popen(['find', ...) statement with something platform-independent. (There's no magic in searching a directory tree under Python, using "find" was simpler for me.)
Creates two shell scripts (bash):
-
action.rename.sh
contains renaming command proposals for tag files where there are topics of the same name in other wikiwebs. Uncomment lines in this script as necessary, then run.
-
action.rename.sh
contains commands for removing files where there are no equally name topics in other wikiwebs.
Note that this script only helps with renamed wikiwebs, not with renamed topics.
Renamed topics are considered as candidates for removal.
If you have log files telling you about past topics renamings you might
use that information ... but my script does not do that.
Hope this may help someone out there.
--
ChristianKern, 2020-06-17