We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Bug: Session variables will override preferences listed in FINALPREFERENCES

If a preference is listed in FINALPREFERENCES, setting a session variable (with something like SmartSessionPlugin and SessionPlugin) will override that final preference.

Test case

Put SKIN in FINALPREFERENCES in TWikiPreferences. Now try to set SKIN in the user's TWiki page. This SKIN will not work. Now use SmartSessionPlugin or SessionPlugin to set a "sticky skin." The session variable WILL override the pre-set SKIN.

This will become more important if and when I upload a version of SmartSessionPlugin that provides a TWikiVariable that allows users to set and get session variables. Right now the problem only SEEMS to surround %SKIN% right now, until other plugins start using setSessionVariable. The changes I'm about to make will provide a plugin that gives users access to setSessionVariable.

This patch to Prefs.pm should fix it:

<pre>
===================================================================
RCS file: Prefs.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -r1.1 -r1.2
186c186,189
<         return $sessionValue;
---
>     # BUG: This allows session variable to override final preference
>     #    return $sessionValue; 
>     # This should fix it
>          prvAddToPrefsList( $theKey, $sessionValue );
</pre>

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, SmartSessionPlugin
Server OS: Linux
Web server: Apache
Perl version: 5.6.0
Client OS: MS Windows 2000
Web Browser: MSIE 5.5

-- TedPavlic - 24 Aug 2003

Follow up

Fix record

Topic revision: r1 - 24 Aug 2003 - 02:45:00 - TedPavlic
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback