Page MenuHomePhabricator

Localizable messages with spaces in the name cause fatal exception - should fail gracefully
Closed, ResolvedPublicPRODUCTION ERROR

Description

If a localizable message with spaces in the name (e.g. {{{button text}}}) is included in a banner, then the banner becomes uneditable through the CentralNotice interface, producing a fatal exception. Though documentation instructs to use hyphenated names, including spaces should either work or at least fail in a less confusing manner.

[41e6ca5a] 2013-10-21 12:28:21: Fatal exception of type MWException

2013-10-21 15:30:55 mw1090 metawiki: [43570c48] /wiki/Special:CentralNoticeBanners/edit/B12_1026_US1_Jimmy   Exception from line 1325 of /usr/local/apache/common-local/php-1.22wmf21/includes/HTMLForm.php: Invalid name 'wpmessage-button text' passed to HTMLFormField::__construct
#0 /usr/local/apache/common-local/php-1.22wmf21/extensions/CentralNotice/includes/HtmlFormElements/HTMLCentralNoticeBannerMessage.php(43): HTMLFormField->__construct(Array)
#1 /usr/local/apache/common-local/php-1.22wmf21/includes/HTMLForm.php(311): HTMLCentralNoticeBannerMessage->__construct(Array)
#2 /usr/local/apache/common-local/php-1.22wmf21/includes/HTMLForm.php(225): HTMLForm::loadInputFromParameters('message-button text', Array)
#3 /usr/local/apache/common-local/php-1.22wmf21/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(315): HTMLForm->__construct(Array, Object(RequestContext), 'centralnotice')
#4 /usr/local/apache/common-local/php-1.22wmf21/extensions/CentralNotice/special/SpecialCentralNoticeBanners.php(75): SpecialCentralNoticeBanners->showBannerEditor()
#5 /usr/local/apache/common-local/php-1.22wmf21/includes/SpecialPage.php(631): SpecialCentralNoticeBanners->execute('edit/B12_1026_US1_Jimmy')
#6 /usr/local/apache/common-local/php-1.22wmf21/includes/SpecialPageFactory.php(489): SpecialPage->run('edit/B12_1026_US1_Jimmy')
#7 /usr/local/apache/common-local/php-1.22wmf21/includes/Wiki.php(298): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#8 /usr/local/apache/common-local/php-1.22wmf21/includes/Wiki.php(602): MediaWiki->performRequest()
#9 /usr/local/apache/common-local/php-1.22wmf21/includes/Wiki.php(467): MediaWiki->main()
#10 /usr/local/apache/common-local/php-1.22wmf21/index.php(49): MediaWiki->run()
#11 /usr/local/apache/common-local/w/index.php(3): require('/usr/local/apache/common-local/php-1.22wmf21/index.php')
#12 {main}

Version: unspecified
Severity: major

Details

Reference
bz56105

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:31 AM
bzimport set Reference to bz56105.
bzimport added a subscriber: Unknown Object (MLST).

So for this task, should we use the hyphenated names or do something else, because i am thinking of using the hyphenated names. By replacing 'wpmessage-button text' to 'wpmessage-button-text' and make changes in the code where the name is used.

Message keys really should not contain spaces...

Where are the messages located? I believe they are not in the i18n files of the extension.

Where are the messages located? I believe they are not in the i18n files of the extension.

On-wiki. (So-called database messages.)

Krinkle raised the priority of this task from Medium to High.EditedOct 27 2018, 8:57 PM
Krinkle removed a project: good first task.
Krinkle subscribed.

Still seen on 1.33-wmf.1 at https://meta.wikimedia.org/wiki/Special:CentralNoticeBanners/edit/B12_1026_US1_Jimmy.

  • Raising priority because this is a public GET url that triggers an HTTP 5xx error.
  • Removing Easy (goodfirstbug) tag, as this does not appear to be easy to solve for a new comer.

See also T149240.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM