• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

The handleCommonTags() handler might get called before all preference levels, i.e. read from the session object, are initialized. That's because the plugins are enabled before the session values are pushed in. See TWiki.pm lines 1191 and 1193. They are in the wrong order. The SESSION level needs to be initialized right after the TOPIC level.

Here's the proposed patch:

--- TWiki.pm    (revision 7706)
+++ TWiki.pm    (working copy)
@@ -1185,15 +1185,14 @@
     $prefs->pushPreferences(
         $this->{webName}, $this->{topicName}, 'TOPIC' );

+    $prefs->pushPreferenceValues( 'SESSION',
+                                  $this->{client}->getSessionValues() );
+
     $this->{renderer} = new TWiki::Render( $this );

     # Finish plugin initialization - register handlers
     $this->{plugins}->enable();

-    $prefs->pushPreferenceValues( 'SESSION',
-                                  $this->{client}->getSessionValues() );
-
-
     # language information; must be loaded after
     # *all possible preferences sources* are available
     $this->{i18n} = TWiki::I18N::get( $this );

Unfortunately the unit tests segfault on my debian/testing. Otherwise I would've checked that in already. Can someone do that, please, and see if it generates the same errors as before wink

Cairo and Beijing using the SessionPlugin behave just fine: a getPreferencesValue("FooBar") returns the session value before consulting the topic/web settings.


I made the change, and it seems OK, but please make sure you test around it before closing this.

SVN 7717

CC

Works like a charm. Fixed.

MD

ItemTemplate
Summary handleCommonTags() called before preferences are fully loaded
ReportedBy MichaelDaum
Codebase

SVN Range Tue, 29 Nov 2005 build 7670
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins 7717
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2005-12-05 - MichaelDaum
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback