Last modified: 2014-04-29 22:30:58 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 T49395, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47395 - jqueryMsg can not parse wikilink with dollar sign in page name
jqueryMsg can not parse wikilink with dollar sign in page name
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 51388 53346 58961 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-19 04:58 UTC by Matthew Flaschen
Modified: 2014-04-29 22:30 UTC (History)
7 users (show)

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


Attachments

Description Matthew Flaschen 2013-04-19 04:58:42 UTC
jqueryMsg can not handle a message with source:

'[[Special:GettingStarted/task/$1|Try another article ►]]'

and a string parameter (e.g. 'copyedit').

This works fine on the server.  It renders to:

<a href="/wiki/Special:GettingStarted/task/copyedit" title="Special:GettingStarted/task/copyedit">Try another article ►</a>

I suspect that support for replacements in such places needs to be broadened in general.  Right now, EXTLINKPARAM is a related special case.
Comment 1 Bartosz Dziewoński 2013-07-25 17:38:50 UTC
*** Bug 51388 has been marked as a duplicate of this bug. ***
Comment 2 Bartosz Dziewoński 2013-08-26 15:57:06 UTC
*** Bug 53346 has been marked as a duplicate of this bug. ***
Comment 3 Helder 2013-10-24 12:00:00 UTC
Confirmed. I tested the following code on Google Chrome console

mw.loader.using( 'mediawiki.jqueryMsg', function(){
  mw.messages.set( {
    bug47395a: '[[$1|Text]]',
    bug47395b: '[[link|$1]]'
  } );
  alert(
    mw.message( 'bug47395a', 'ABC' ).plain() + ': ' +
    mw.message( 'bug47395a', 'ABC' ).parse() + '\n' +
    mw.message( 'bug47395b', 'ABC' ).plain() + ': ' +
    mw.message( 'bug47395b', 'ABC' ).parse()
  );
} );

and got the following message on Portuguese Wikipedia:

[[ABC|Text]]: bug47395a: Parse error at position 0 in input: [[$1|Text]]
[[link|ABC]]: <a title="link" href="/wiki/link">ABC</a>
Comment 4 Bartosz Dziewoński 2013-12-25 14:40:07 UTC
*** Bug 58961 has been marked as a duplicate of this bug. ***
Comment 5 mdowdell 2014-04-29 22:30:58 UTC
For anyone interested, you can workaround this until this is fixed:

mw.loader.using( 'mediawiki.jqueryMsg', function () {

    mw.messages.set( {
        foo: '[[$1]]'
    } );

    var msg = mw.message( 'foo', 'bar' ).plain();
    // [[bar]]

    mw.messages.set( {
        'some-random-message': msg
    } );

    msg = mw.message( 'some-random-message' ).parse();
    // <a title="bar" href="/wiki/bar">bar</a>

    console.log( msg );

} );

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


Navigation
Links