Hi,
I'm proposing a new category: Anti Patterns!
Here's one:
Instead of writing:
#set($obj = $doc.getObject("XWiki.XWikiUsers"))
#if ($obj.avatar == "...")
...
Write:
#set($obj = $doc.getObject("XWiki.XWikiUsers"))
#if ($obj.getProperty("avatar") &&
$obj.getProperty("avatar").getValue
() == "...")
...
Reason:
$obj.avatar actually is equivalent to: $doc.display("avatar", $obj)
And the display() method renders differently when in view mode, in
inline mode, etc. For example in inline mode it generates an HTML
form INPUT element...
WDYT?
Thanks
-Vincent