Last modified: 2011-12-06 19:23:23 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 T33995, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31995 - Addition of PPFrame::getTitle
Addition of PPFrame::getTitle
Status: VERIFIED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-27 18:47 UTC by Van de Bugger
Modified: 2011-12-06 19:23 UTC (History)
2 users (show)

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


Attachments
Trivial getTitle implementation. (1.24 KB, patch)
2011-10-27 18:48 UTC, Van de Bugger
Details

Description Van de Bugger 2011-10-27 18:47:27 UTC
Let us make frame title available through method getTitle. It allows parser functions to access title of current frame. It makes possible magic words or parser functions which know the name of current frame, like {{SRCNAME}} (discussed in 24284). In turn, {{SRCNAME}} makes possible "template-scope" variables, e. g. {{ #vardefine: {{SRCNAME}}:i }}, {{ #var: {{SRCNAME}}:i }}. It also makes possible extensions which does the same even more gracefully: {{ #localdefine: i }}, {{ #local: i }}. (localdefine, local are parser function which set/get "template-scope" variables; I wrote "template-scope" in parentheses because these variables are available outside by using "full" name: {{ #var: Templatename:i }}.)
Comment 1 Van de Bugger 2011-10-27 18:48:00 UTC
Created attachment 9300 [details]
Trivial getTitle implementation.
Comment 2 Sumana Harihareswara 2011-11-09 20:46:48 UTC
Adding the "need-review" and "patch" keywords, for patches that need review by developers.  Van de Bugger, thank you for your patch.
Comment 3 Sam Reed (reedy) 2011-11-09 20:53:29 UTC
Reviewed, and applied in r102571

Also did Preprocessor_HipHop as it exists in trunk (and 1.18?)

Technically wasn't needed, because $title is var (so public), but certainly the better way to do it than direct member variable access!

Thanks
Comment 4 Van de Bugger 2011-11-12 10:29:18 UTC
Verified on r102853.
Comment 5 Daniel A. R. Werner 2011-12-06 19:23:23 UTC
Great, it once took me a while to get the idea that there was a public $mTitle. For additions like this I would really appreciate to see the '@since' in the function documentation. Would make it a lot easier to keep backwards compatibility in extensions.

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


Navigation
Links