• 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.

I'd like to turn off WEBHEADERART, cleanly, by using Main.TWikiPreferences. However, since WEBHEADERART is set in TWiki.TWikiPreferences, all I can do is to set it to an empty value (as far as I know there's no means to completely undefine a variable --no Unset to complement Set).

The problem is that stylesdynamic.pattern.tmpl uses the following code:

%IF{ 'defined WEBHEADERART' then='#patternTopBar { background-image:url("%WEBHEADERART%"); background-repeat:no-repeat;}'}%

and WEBHEADERART is still defined, albeit empty. This results in the following in the output HTML:

#patternTopBar { background-image:url(""); background-repeat:no-repeat;}

which, for some reason beyond my ken, causes the browser to ask for the page again, e.g.:

macabre - - [25/May/2006:14:17:43 -0400] "GET /Optics/Main/DiabJerius HTTP/1.1" 200 20365
macabre - - [25/May/2006:14:17:44 -0400] "GET /Optics/Main/DiabJerius HTTP/1.1" 200 16384

Now, you might think that this is harmless, but I think its not, and here's my reasoning. Please pardon the verbosity!

I've been tracking down a sudden loss of authentication, where there's an inexplicable loss of knowledge about the user, and the demoting of the user to "guest". The cause is that TWiki::Client::loadSession() attempts to load an existing session file, only to find it empty! The problem is that sometimes, when the session file is written using TWiki::Client::finish(), the session file is opened, truncated, and then TWiki quite literally disappears before the session information is written (this happens sometime after the sysopen call in CGI::Session::File::store()).

Here's what I mean by it disappearing. I've replaced bin/view with the following script:


echo "" >> /tmp/view.log
echo "$$------" >> /tmp/view.log
./view.exe "$@" 2>> /tmp/view.log
echo status = $? >> /tmp/view.log
echo "$$------" >> /tmp/view.log

Now, here's the output:

status = 0


status = 0


status = 0


Notice that there are several calls to view which do not show the bracketed status line. The script never gets to that echo status line! This can only mean that apache shut it down; there's no way to avoid that line short of another process killing the view script. I have no idea why it is doing this.

Back to WEBHEADERART. If I comment out all of the Set WEBHEADERART statements everywhere, so that it is never defined, the output HTML doesn't have that empty background-image:url(""); image, there isn't a second attempt to retrieve the page, and so far I haven't seen the authentication drop problems.

So please, change the code so that it looks like this:

        %IF{ "defined WEBHEADERART and $ WEBHEADERART != ''" then='#patternTopBar { background-image:url("%WEBHEADERART%"); background-repeat:no-repeat;}'}%

Note that the original code uses a single quote as the delimiter; the TWiki variable parser is unhappy if the code looks like

%IF{ 'defined WEBHEADERART and $ WEBHEADERART != ""' ...}

I see this problem using the Galeon and Firefox browsers against an apache 2.0.53 server on Fedora Core 3. I don't know if it's browser specific, server specific etc.

This one was a real bear to track down!


-- TWiki:Main.DiabJerius

Diab's fix look very sensible to me. We should not need to force people to edit TWiki.TWikiPreferences and as Diab explains - we have no way of unsetting a variable. I have tested his fix and found no reason not to include it. I have committed the change. Ready for release.

-- KJL

Makes sense. AC

Summary Unable to cleanly turn off WEBHEADERART completely causing unexpected major problems
ReportedBy TWiki:Main.DiabJerius
Codebase 4.0.2, ~twiki4, ~develop
SVN Range Wed, 24 May 2006 build 10305
AppliesTo Extension
Component PatternSkin
Priority Urgent
CurrentState Closed

Checkins 10396 10397
TargetRelease patch
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r8 - 2006-05-31 - ArthurClemens
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback