Last modified: 2011-03-13 18:06:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15336, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13336 - Use of #ask+template in parser fucntions/annotations
Use of #ask+template in parser fucntions/annotations
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Lowest enhancement with 1 vote (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-12 20:46 UTC by DaSch
Modified: 2011-03-13 18:06 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description DaSch 2008-03-12 20:46:26 UTC
when including a template into an Semantic Link like [[Property::{{Template}}]] there is some Problem with the [[SMW:Off]] used in SMW_QP_Template.php

when changing
$parserinput .= '[[SMW::off]]{{' . $this->m_template .  $wikitext . '}}[[SMW::on]]';

to

$parserinput .= '{{' . $this->m_template .  $wikitext . '}}';

it works fine
Comment 1 DaSch 2008-03-12 21:32:55 UTC
sry i have not seen that this makes somehow strang effects on Categories, I think this is a very big Problem, maybe there should be a different Handling for templates an Parser Funktions with {{#
Comment 2 DaSch 2008-03-12 22:20:15 UTC
This Constelation creates strang effects

--Template 1--
<includeonly>[[Bevölkerungsdichte::{{#ask:[[{{PAGENAME}}]]|?Einwohnerzahl|?Fläche|format=template|template=SMW-Bevölkerungsdichte|link=none}}Einwohner pro km²]]--></includeonly><noinclude>{{Dokumentation}}</noinclude>

--Template 2--
<includeonly>{{formatnum:{{#expr:{{#replace:{{{1}}}|.|}}div{{#sub:{{#replace:{{{2}}}|.|}}|0|-9}} round 2}}}}</includeonly> <noinclude>{{Dokumentation}}</noinclude>
Comment 3 Markus Krötzsch 2008-03-14 08:01:11 UTC
You try to reuse the output of an #ask that uses a template as the value for further parser functions/annotations. This is not supported. Note that the old <ask> did not support this at all, while it now works for all non-templaet outputs of #ask. 

Therefore this is not a critical bug, but rather a feature request to somehow enable reuse of templated outputs in annotations. The reason for using the internal [[SMW::on]] and [[SMW:off]] (no user-space features -- might vanish in the future!) is to prevent #ask results that embed other pages' contents to annotate the page they appear on. One could probably solve this in another way, but I have no good idea yet. 

Looking at your example, you could use two separate queries with "mainlabel=-" and "limit=1" to retrieve both numbers individually. Then the results need no template and you can use the parser function as desired.
Comment 4 Siebrand Mazeland 2008-08-11 11:05:27 UTC
Re-assign to extension developer for triage/comments.
Comment 5 Markus Krötzsch 2009-07-31 14:34:33 UTC
I still believe my previous reply pretty much solves this to the extent that I can solve it at all. Since there were no further comments, I close this bug as WONTFIX now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links