Item8228: SETVAR macro will be applied unexpectedly to other topics

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release:
Applies To: Extension
Component: SetVariablePlugin
Branches:
Reported By: Foswiki:Main.SebastianPinnau
Waiting For:
Last Change By: MichaelDaum
After using the SETVAR and UNSETVAR macros the preferences will be applied unexpectedly to other topics too. The problem occurs on my foswiki 1.0.6 installation with PatternSkin and can be reproduced with the following steps:

  • Insert a SETVAR or UNSETVAR macro on a topic. The settings will then be applied as expected.
  • Now edit an other topic without using SETVAR or UNSETVAR macros on it. Then the settings from the last topic (from last SETVAR call) will be added to this topic.

I played a little bit around with the DEBUGRULES macro and find out, that SETVAR rules seems to be stored. On each edit/save cycle on a topic with a SETVAR macro a new line gets appended to the DEBUGRULES table (please see the attached screenshot). If you edit another topic without an SETVAR statement but insert the DEBUGRULES macro, then the same rules as on the previous topic are shown. My example SETVAR call for this was:

%SETVAR{"ALLOWTOPICVIEW" type="Set" value="SomeGroup"}%

I have edited the Core.pm file and added @{$this->{rules}} = (); to the end of the handleBeforeSave function to delete all rules after saving the topic. After this the DEBUGRULES table looks at expected for me, but the last rules will still be appended to the next edited topic.

I have added some description of my desired use case for the SetVariablePlugin to SetVariablePlugin

-- SebastianPinnau - 05 Aug 2009

After further testing it seems the problem is related to FastCGIEngineContrib. I'm using this extension on apache2 with mod_fcgid. If i turn off mod_fcgid in my apache config then all works fine.

-- SebastianPinnau - 05 Aug 2009

The proper fix is to undef the $core in initPlugin

-- MichaelDaum - 17 Nov 2009
 

ItemTemplate edit

Summary SETVAR macro will be applied unexpectedly to other topics
ReportedBy Foswiki:Main.SebastianPinnau
Codebase 1.0.6
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component SetVariablePlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins SetVariablePlugin:1f1a022b01b4
ReleasedIn
I Attachment Action Size Date Who Comment
Screenshot.jpgjpg Screenshot.jpg manage 37 K 05 Aug 2009 - 07:56 SebastianPinnau Screenshot showing DEBUGRULES table
Topic revision: r5 - 17 Nov 2009, MichaelDaum
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