Last modified: 2008-09-15 19:29:03 UTC
When using a template for the output of the ask-parser there should be created a link to the template 1. Because the templates are now listed as not used 2. Because then the template could be seen linked at the bottom of the page when editing
I see this bug on my local SMW 1.1/MediaWiki 1.11.0 installation, but not on sandbox.semantic-mediawiki.org running SMW 1.2 D pre-release. On sandbox, so long as the inline query displays some results using the template, the page shows up in Special:WhatLinksHere/Template:MyTemplate and the template shows up in the page's "Templates used in this preview:". (I didn't test cases where the inline query output is/isn't SMW_OUTPUT_HTML.) So maybe recent code fixed this bug and it's WORKSFORME. ''If'' you wanted to address cases where the inline query never invokes the template (no results or limit=0), then I skimmed my 2007 MediaWiki code, and there's an explicit ParserOuput->addTemplate() call; or invoking Parser->fetchTemplate() to get the template contents calls addTemplate(). But relying on MediaWiki's normal parsing to notice the use of a template is probably the best way to go.
This should work properly in SMW 1.3 (maybe in 1.2 as well, but I did not check), as long as #ask is used. The old <ask> did not show the desired behaviour, but there is no reason to use this outdated syntax any more. In principle, SMW's architecture allows for result formats that use templates internally without MediaWiki noticing it, and in this case the templates would still not appear. But all of SMW's built-in template-based formats should work as expected.