Last modified: 2014-01-21 00:01:19 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 T49089, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47089 - Add a method of determining which Module was invoked from within Lua
Add a method of determining which Module was invoked from within Lua
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 48176
  Show dependency treegraph
 
Reported: 2013-04-10 17:42 UTC by Robert Rohde
Modified: 2014-01-21 00:01 UTC (History)
4 users (show)

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


Attachments

Description Robert Rohde 2013-04-10 17:42:22 UTC
I'd like to request that a method be added to determine from within Lua what Module name was present in the invoke instruction, i.e.

{{ #invoke: MyModule | test }}

I'd like the called function to be able to determine that MyModule is the origin of the call.

My use case for this is being able to differentiate behavior for:

{{ #invoke: MyModule | test }} and
{{ #invoke: MyModule/sandbox | test }}

Where the sandbox is likely to contain near identical code to the main Module but you might want it to do something different (e.g. add extra diagnostic output, include the /sandbox version other modules rather than the main version, etc.)

The most natural way that I can see to do this is to have the Lua function look for "/sandbox" in the name of the invoked Module, but there doesn't seem to be any way at present for Lua to know what Module was being invoked.
Comment 1 Gerrit Notification Bot 2013-12-07 01:04:47 UTC
Change 99797 had a related patch set uploaded by Anomie:
Expose PPFrame::getTitle to Lua

https://gerrit.wikimedia.org/r/99797
Comment 2 Gerrit Notification Bot 2013-12-10 04:29:36 UTC
Change 99797 merged by jenkins-bot:
Expose PPFrame::getTitle to Lua

https://gerrit.wikimedia.org/r/99797
Comment 3 Brad Jorsch 2013-12-10 15:51:59 UTC
Change has been merged. It should be deployed to WMF wikis with 1.23wmf7, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.

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


Navigation
Links