Last modified: 2007-07-13 02:23:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10548 - '$wgOut->parse( "{{subst::test}}" );' does not seem to work
'$wgOut->parse( "{{subst::test}}" );' does not seem to work
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-07-12 06:51 UTC by Nick Jenkins
Modified: 2007-07-13 02:23 UTC (History)
1 user (show)

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


Description Nick Jenkins 2007-07-12 06:51:53 UTC
Steps to reproduce; problem is step 5:

Step 1) Create a dummy page at [[test]].
Step 2) Edit index.php, and to the end add:
        global $wgOut;
        print $wgOut->parse( "[[test]]") ;
Step 3) View the wiki, and observe that a link to "test" is indeed added to the page footer.
Step 4) Edit index.php, and change the above two lines to read:
        global $wgOut;
        print $wgOut->parse( "{{subst::test}}" );
Step 5) View the wiki, and observe that rather than the contents of "test" being included, the output is the literal string "{{subst::test}}".
Step 6) Make a new wiki page, insert "{{subst::test}}", and save, to confirm that this wiki text as part of an article does include the contents of "test".

Please note that I am assuming that $wgOut->parse() is intended to handle arbitrary wiki text. If this is not the case, then this behaviour may be by-design, in which case please close this bug as Invalid.
Comment 1 Brion Vibber 2007-07-12 14:05:08 UTC
Subst is a pre-save transform step, not a parse-time step.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-07-13 00:40:04 UTC
(Also, surely there should be a single colon there and not two . . .)
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-07-13 01:54:57 UTC
(Er, right, it was a page in the main namespace, so that's correct.  Never mind me.)
Comment 4 Nick Jenkins 2007-07-13 02:23:16 UTC
Below is more along the lines of what I should have done, thanks to Simetrical:
   $page_title = "test";
   $title = Title::makeTitle( NS_MAIN, $page_title );
   $revision = Revision::newFromTitle( $title );
   $wgOut->addWikiText( $revision->getRawText() );

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