NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item10966: normalizeWebTopic defaults to %USERSWEB for no good reason

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Confirmed Engine FoswikiSandbox, FoswikiFunc  
This one has driven be nuts today. This call

my ($web, $topic) = Foswiki::Func::normalizeWebTopicName('', 'FooBar');

(empty, zero, or undef does not matter for the web param)

will return

$web == $Foswiki::cfg{UsersWebName}

$topic == 'FooBar'

... which sux. There's no good reason for normalizeWebTopicName to use the %USERSWEB as a default in case the web param is undefined.

In fact, there are quite a couple of plugins that might run into weird things when somehow the %USERSWEB is coming into play.

Happens at least in DBCacheContrib. That's from where I came across this. Will list more as I find the pattern elsewhere.

Of course, this might be due to legacy. Changing this to a more sensible default, e.g. %BASEWEB, might be dangerous. I still think it is worth fixing as the number of plugins and wiki apps assuming a %USERSWEB default is rather low if not zero.

-- MichaelDaum - 14 Jul 2011

I also can't think of a good reason for why this default is like that, but it has always been this way and it's clearly documented. So I do not agree that it is urgent.

As the bug is so very ancient, I just don't know that we should rush it into 1.1.4. But on the other hand, I'm not sure why waiting would help, unless it's to ask for feedback.

-- PaulHarvey - 15 Jul 2011

I agree; it's ancient, and it's not urgent, so I'm lowering it to "normal", but it is a PITA. The legacy stretches back to the very beginning (perhaps even to JosWiki) and is logical if you consider that there was a time before the System web came into existence.

I quite like the idea of a BASEWEB but think it should be a configure setting (I don't like the idea of it being overridden on a per-topic basis)

-- CrawfordCurrie - 17 Jul 2011

Deferring to 1.2 / 2.0

-- GeorgeClark - 13 Dec 2011
 

ItemTemplate edit

Summary normalizeWebTopic defaults to %USERSWEB for no good reason
ReportedBy MichaelDaum
Codebase 1.1.4 RC1, 1.1.4 beta2, 1.1.4 beta1, 1.1.3, trunk
SVN Range
AppliesTo Engine
Component FoswikiSandbox, FoswikiFunc
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease patch
ReleasedIn 1.2.0
trunkCheckins
Release01x01Checkins
Topic revision: r4 - 13 Dec 2011, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads