Page MenuHomePhabricator

Create an analogue of {{#for_external_table:}} correctly processing parser function calls involving local variables
Closed, ResolvedPublicFeature

Description

Currently, the use of {{#for_external_table:}} is limited by the fact that all parser function calls in its input are resolved before the local variables are substituted.

The alternative is {{#display_external_table:}}, which requires an auxilliary template displaying a row of data, but has no such limitation. However, creating a template is not always feasible, for example, when a "template" is stored semantically.

Therefore, a way to display an array of values that substitutes local variables before invoking parser functions in the "template". Most probably, it should be a parser tag.

Alternatively, a more flexible way of attaching parser functions to {{{var}}} clauses has to be invented.

Event Timeline

alex-mashin changed the task status from Open to In Progress.Aug 28 2022, 6:28 AM
alex-mashin claimed this task.
alex-mashin added a subscriber: Yaron_Koren.

Change 826989 had a related patch set uploaded (by Alex Mashin; author: mashin):

[mediawiki/extensions/ExternalData@master] Overcome the limitations of {{#for_external_table:}}

https://gerrit.wikimedia.org/r/826989

Change 826989 merged by jenkins-bot:

[mediawiki/extensions/ExternalData@master] Overcome the limitations of {{#for_external_table:}}

https://gerrit.wikimedia.org/r/826989

Resolved by expanding {{{…}}} in the optional second parametre before expanding templates and parser functions.

{{#for_external_table:|<nowiki />
* {{lc:{{{var}}}}}
}}

will now work intuitively, while

{{#for_external_table:<nowiki />
* {{lc:{{{var}}}}}
}}

as it previouely did.