Item12394: Warnings in logs when using subwebs and ContributorsPlugin

pencil
Priority: Normal
Current State: New
Released In: n/a
Target Release:
Applies To: Extension
Component: ContributorsPlugin
Branches:
Reported By: JeanBaptisteMayer
Waiting For:
Last Change By: JeanBaptisteMayer
I am deploying ContributorsPlugin on a semi-public Foswiki installation with subwebs.

I noticed that when the plugin tries to write the per-page contributors cache the following lines appear in the log:
FastCGI: server "/XXX/wiki/foswiki.fcgi" stderr: print() on closed filehandle TICK at /XXX/lib/Foswiki/Plugins/ContributorsPlugin.pm line 309.

I traced it to an incorrect filename generation in sub makeCacheFilename (ContributorsPlugin.pm, line 298) where the filename is the contatenation of the web, topic, revision. The sub does not check for slashes in the web name as is frequent with subwebs - thus tries to create a file in a folder that does not exist.

I suggest adding the following regular expression line 299:
    $file=~s/\//_/;

-- JeanBaptisteMayer - 13 Feb 2013

 
Topic revision: r1 - 13 Feb 2013, JeanBaptisteMayer
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy