Page MenuHomePhabricator

frame object should have property indicating subst status
Closed, ResolvedPublic


The frame object should have property indicating subst status, say

frame.isSubsted = true/false

at least for the frame created by {{#invoke:}}, but preferably for parent frame as well.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:20 AM
bzimport set Reference to bz47828.

Looking at how substing actually works, you can't have different "isSubsting" statuses for the different frames:

  • If the parent is being substed, then either the #invoke is being substed too or it's not even processed at that phase of the parse. By the time it is processed, the original parent is already gone and you've got a new one that isn't being substed.
  • If the parent is not being substed, then the #invoke cannot be substed either because there's no place for it to be substed *into*.

So it makes more sense to me to just have a static "mw.isSubsting()" function instead of a method on the frame object.

Also, I note that a hack like enwiki's [[Template:Ifsubst]] works as well in Scribunto:

if frame:preprocess( '{{subst:NAMESPACE}}' ) ~= '{{subst:NAMESPACE}}' then

  • substing


  • Not substing


Change 93019 had a related patch set uploaded by Anomie:
Add mw.isSubsting()

Change 93019 merged by jenkins-bot:
Add mw.isSubsting()

Change merged. It should be deployed to WMF wikis with 1.23wmf3, see for the schedule.

Change 139597 had a related patch set uploaded by MarkAHershberger:
Add mw.isSubsting()