Last modified: 2014-06-16 17:38:31 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 T49828, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47828 - frame object should have property indicating subst status
frame object should have property indicating subst status
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks: 48176
  Show dependency treegraph
 
Reported: 2013-04-29 13:56 UTC by Danny B.
Modified: 2014-06-16 17:38 UTC (History)
3 users (show)

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


Attachments

Description Danny B. 2013-04-29 13:56:16 UTC
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.
Comment 1 Brad Jorsch 2013-11-01 02:27:14 UTC
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
	else
		-- Not substing
	end
Comment 2 Gerrit Notification Bot 2013-11-01 02:27:26 UTC
Change 93019 had a related patch set uploaded by Anomie:
Add mw.isSubsting()

https://gerrit.wikimedia.org/r/93019
Comment 3 Gerrit Notification Bot 2013-11-06 18:26:57 UTC
Change 93019 merged by jenkins-bot:
Add mw.isSubsting()

https://gerrit.wikimedia.org/r/93019
Comment 4 Brad Jorsch 2013-11-06 18:48:29 UTC
Change merged. It should be deployed to WMF wikis with 1.23wmf3, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.
Comment 5 Gerrit Notification Bot 2014-06-14 13:30:01 UTC
Change 139597 had a related patch set uploaded by MarkAHershberger:
Add mw.isSubsting()

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

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


Navigation
Links