Page MenuHomePhabricator

expandTemplate doesn’t create a new frame
Closed, ResolvedPublic

Description

When a Lua module uses the function frame:expandTemplate, this doesn’t create a new frame (contrary to frame:preprocess) but expand the template in the "top" frame (the parent frame of the expanded template is the top frame).

I guess this is a bug since the "parent frame" is defined as the "the frame for the page that called {{#invoke:}}" ([[mw:Extension:Scribunto/Lua reference manual#frame:getParent]]).

I created some pages to illustrate this behaviour on https://test2.wikipedia.org/wiki/Multiple_transclusion. It can be remarked also that if you again transclude the "Multiple transclusion" page, the first case shows the new top frame.


Version: unspecified
Severity: normal
URL: https://test2.wikipedia.org/wiki/Multiple_transclusion

Details

Reference
bz60207

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:05 AM
bzimport added a project: Scribunto.
bzimport set Reference to bz60207.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

When a Lua module uses the function frame:expandTemplate, this doesn’t
create a
new frame (contrary to frame:preprocess) but expand the template in the "top"
frame (the parent frame of the expanded template is the top frame).

A new frame *is* being created, but it's getting the wrong title and isn't a child of the frame it should be a child of.

While it's not exactly obvious, this is the same as the problem in bug 55525.

  • This bug has been marked as a duplicate of bug 55525 ***