Last modified: 2012-01-29 03:38:50 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 T30075, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28075 - Expansion of #ask's default= parameter should be deferred
Expansion of #ask's default= parameter should be deferred
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-16 13:43 UTC by Daniel Friesen
Modified: 2012-01-29 03:38 UTC (History)
2 users (show)

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


Attachments

Description Daniel Friesen 2011-03-16 13:43:14 UTC
#ask is unnecessarily expanding default=, it should be deferring expansion like #if and other parser functions do.

This means that for templates using something like:
{{#ask: ...some query... | default= {{#ask: ...some fallback query... }} }}

The second #ask is always executed, running unnecessary extra sql queries and affecting performance in cases where the first #ask does in fact have contents.
Comment 1 Daniel A. R. Werner 2012-01-29 02:02:19 UTC
I agree. One thing I am curious about though, why is there a replacement of "_" against " " happening for the 'default' parameter?
The 'default' parameter handling is happening in SMWResultPrinter class right now, perhaps it should be moved to the parser function since it is more like a basic feature of the parser function rather than a result format specific feature.
Same for 'intro' and 'outro', which in addition should not be expanded in case we expand the 'default'.
Comment 2 Jeroen De Dauw 2012-01-29 03:38:50 UTC
+1. We should not expand stuff that's not used.

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


Navigation
Links