Sandbox.TestTopic0NotExist/info.rev
should be
undef
- instead
Sandbox.TestTopic0NotExist/info.
evaluates to undef, and then
rev
is treated as a seperate literal string.
- IF{"Sandbox.TestTopic0NotExist/info.rev = 'rev'" then="broken" else="ok"}
- IF{"Sandbox.TestTopic0NotExist/info.version = 'version'" then="broken" else="ok"}
damn. it
should be undef.
--
TWiki:Main.SvenDowideit - 27 May 2008
- IF{"istopic fields[name='nonEdistantField']" then="broken" else="ok"}
- IF{"istopic fields[name='nonEdistantField'].value" then="broken" else="ok"}
looks like undef eval
is sodded
--
TWiki:Main.SvenDowideit - 30 May 2008
--
TWiki:Main/SvenDowideit - 01 Jun 2008
This is all a question of context. When a dot operator is evaluated, the name on the LHS is evaluated in the current context. This normally means in the context of the meta-data of the current topic, so that an expression like
info.rev
works relative to that meta-data. However this doesn't work when the LHS of the expression is a web name, because web names are not defined relative to the meta-data of a topic.
There are two possible solutions; first, to pass a "root context" down that can be used to evaluate web names. Second, to evaluate web names in the context of the meta-data of the current topic. Of the two, I think the second is probably best.
--
CrawfordCurrie - 28 Jul 2008
you are suggesting that without the web. the tests would succeed - and so... we test em.
- IF{"TestTopic0NotExist/info.rev = 'rev'" then="broken" else="ok"}
- IF{"TestTopic0NotExist/info.version = 'version'" then="broken" else="ok"}
--
SvenDowideit - 28 Jul 2008
The problem is that what you are trying to do is invalid syntax; perfectly understandable, but still invalid. The dot operator is defined as returning a field value. The term before a / is defined as being a string that is the name of a topic. X.Y will evaluate to the name of a topic, but only if X.Y is a field e.g.
parent.name
. If you want to use the web.topic name of a topic, you have to quote it:
- IF{"'Sandbox.TestTopic0NotExist'/info.rev = 'rev'" then="broken" else="ok"}
- IF{"'Sandbox.TestTopic0NotExist'/info.version = 'version'" then="broken" else="ok"}
- IF{"'TestTopic0NotExist'/info.rev = 'rev'" then="broken" else="ok"}
- IF{"'TestTopic0NotExist'/info.version = 'version'" then="broken" else="ok"}
(Note that the above tests may fail because of a second problem that I have since fixed)
I agree the doc is unclear on this point. It would be nice to be able to use web.topic syntax, but that would require excessive amounts of context information.
Upgraded to Urgent because you bugged me about it.
--
CrawfordCurrie - 28 Jul 2008
ah
not the solution I wanted, but good enough :), mucho thanks.
BUT
what about
- IF{"istopic fields[name='nonEdistantField']" then="broken" else="ok"}
- IF{"istopic fields[name='nonEdistantField'].value" then="broken" else="ok"}
--
SvenDowideit - 30 Jul 2008
That is an unrelated problem in
istopic
. It is using
normalizeWebTopicName
which defaults the topic name to WebHome if it is not defined.
Added unit test and fixed.
--
CrawfordCurrie - 30 Jul 2008
small fix for unit tests
--
SvenDowideit - 30 Jul 2008
Cleaned "WaitingFor" field.
--
TWiki:Main.GilmarSantosJr - 10 Aug 2008