Last modified: 2013-03-16 22:31:49 UTC
When there are multiple values for a single property, #ask and #show prints them in a comma delimited format, with 2 spaces after the comma. For multiple values entered into a Semantic Forms field separated by a comma and only 1 space, #ask and #show will insert a second space. If there are no spaces in the Semantic Forms field, then #ask and #show will insert one when displaying it. That is (probably) the expected behavior. The problem only occurs when there is already a space separating multiple values. Then, the display of the values differs from the actual text of the output values, and leads to difficult to diagnose problems. This breaks comparisons between properties. I discovered this bug using the Arrays extension, which removes the extra whitespace, as does almost everything else in MediaWiki-land and HTML-land. That's probably why it took so long to discover this bug - you can't see it without knowing it's there and deliberately looking for it. The bug goes back to at least 1.6, which is as far as I tested. I will post a link to a demo in a few minutes.
Login with Demo/test: http://www.coincompendium.com/w/index.php/Sandbox/Bug_33478
I tested this again in SMW 1.7.0.2 and found that there are undocumented changes that cause different behavior of #ask. Producing the same output as #show as in the demo and bug report here seems to be no longer possible, as far as I know. The demo does not show the intended results anymore, since it was upgraded to 1.7+. You can read my notes on the differences here: http://www.mediawiki.org/wiki/User:Badon#.23ask_multiple_property_comma_delimited_list_format I'm not sure that was intentional (since it's undocumented), so I'll give it some thought and maybe report it as a blocker bug for this bug. Additionally, it is important to mention that fixing only this bug: https://bugzilla.wikimedia.org/show_bug.cgi?id=32863 would have the effect of making this bug irrelevant, and also the bug I may report about the changed #ask behavior.
I updated the demo for this bug to accommodate undocumented breaking changes in SMW 1.7.x, as described here: http://www.mediawiki.org/w/index.php?title=User:Badon&oldid=496431#.23ask_multiple_property_comma_delimited_list_format It is possible to produce the same output as previous versions, as I have discovered, so a bug report will not be made. Most importantly, this bug report is still valid, with the same erroneous output still being produced in the updated demo (login with Demo/test): http://www.coincompendium.com/w/index.php/Sandbox/Bug_33478