Last modified: 2007-07-13 02:23:16 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 T12548, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10548 - '$wgOut->parse( "{{subst::test}}" );' does not seem to work
'$wgOut->parse( "{{subst::test}}" );' does not seem to work
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.11.x
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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.


Navigation
Links