Last modified: 2014-10-14 16:02:09 UTC
Currently if you add something like {{#property:p1234234234}}, it simply returns a empty string. (Example: https://test2.wikipedia.org/w/index.php?title=Germany&diff=53273&oldid=53030) It would be nice if we could add a tracking category to find these instances. Same with {{#property:label}}, where no property actually uses the specified label.
Well, what should the parser function return in an error case? It would have to be some pre-defined, fixed string, right? But that's not good when shown to the user. So, rather, an HTML formatted error? The reason that it currently returns an empty string is to indicate "there's nothing here", so it can be used in conditionals. If you need more fine grained info, you can use Lua. I'd actually like a nice way to return more detailed status/error info from a parser function, but I don't see a good way to do that.
Kunal: *poke* about Daniel's question
(In reply to Daniel Kinzler from comment #1) > Well, what should the parser function return in an error case? It would have > to be some pre-defined, fixed string, right? But that's not good when shown > to the user. So, rather, an HTML formatted error? Sure, that's reasonable. But probably deserves another bug? > The reason that it currently returns an empty string is to indicate "there's > nothing here", so it can be used in conditionals. If you need more fine > grained info, you can use Lua. Adding a tracking category won't prevent that.
Yea, I didn't know how the "magic" tracking category feature worked when I wrote this. I was assuming it would be returned as wikitext. Calling ParserOutput::addTrackingCategory() would be fine. Also, by now, I'm convinced that in case of an error, the parser function should return a localized, html formatted string wrapped in a span or diff using class="error". Because that can be detected with the {{#iferror}} function.