Page MenuHomePhabricator

error string for missing template in inline query is hardcoded, unformatted
Closed, ResolvedPublic

Description

Author: info

Description:
You have to supply a template parameter if you use format=template, so this is in error:

{{#ask: [[Located in::+]] |format=template }}

This correctly outputs

Please provide parameter "template" for query to work.

(good!) But

a) The string is hardcoded in SMW_QP_Template.php, it's not internationalized.
b) It doesn't appear with the cool yellow warning icon or as a tooltip.

ResultPrinters don't have a clean way to add their own errors to the query parser's errors, but changing line 33 to something like

return smwfEncodeMessages(array(wfMsgForContent('smw_qpneedstemplate')));

helps.
D'oh, I see there's already a note in the SMW_QP_Template.php code // TODO: internationalise, beautify
sorry to file a bug for a TODO.


Version: unspecified
Severity: minor
URL: http://ontoworld.org/wiki/SMW_unit_test:Test_inline_query

Details

Reference
bz13666

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:08 PM
bzimport set Reference to bz13666.