Page MenuHomePhabricator

Lua scripts handling templates should have access to their location in the document and to the global context
Closed, DeclinedPublic

Description

This is a followup to T109372, which isn't doable without such information.

When Lua script is run, it doesn't know its section, therefore it has no way to validate its parameters and arguments which validity depends on the section (like language).
Additionally, it would be best for Lua scripts to have access to the common document context, such that they can exchange information, because some wiktionary templates are inter-dependent, some information can be mutually exclusive, etc. Currently, there is no way to validate the language, and no way to tell if potentially contradictory information has been submitted.

Event Timeline

Yurivict created this task.Sep 18 2015, 7:55 PM
Yurivict raised the priority of this task from to Needs Triage.
Yurivict updated the task description. (Show Details)
Yurivict added a subscriber: Yurivict.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 18 2015, 7:55 PM
Anomie closed this task as Declined.Sep 18 2015, 8:16 PM
Anomie claimed this task.
Anomie added a subscriber: Anomie.

One of the design requirements of Scribunto is that there be no shared state, i.e. any #invoke on a page must return the same result no matter what may have been parsed previously.

So what is the suggested way then how Wiktionary can validate submitted data?

Chances are that anything you might do along these lines would break Parsoid; your best bet might be to talk to that team.

Aklapper renamed this task from [feature request] Lua scripts handling templates need to have access to their location in the document, and need to have access to the global context to Lua scripts handling templates should have access to their location in the document and to the global context.Sep 19 2015, 12:34 PM
Aklapper set Security to None.
Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:28 PM