Item10966: normalizeWebTopic defaults to %USERSWEB for no good reason
Priority: Normal
Current State: Proposal Required
Released In: n/a
Target Release: n/a
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
Bumping to 2.0, and a this is probably a big enough change to need a proposal.
--
GeorgeClark - 19 Jun 2014