Page MenuHomePhabricator

Localizable messages with spaces in the name cause fatal exception - should fail gracefully
Open, HighPublic

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 Normal.Nov 22 2014, 2:31 AM
bzimport set Reference to bz56105.
bzimport added a subscriber: Unknown Object (MLST).
Pcoombe created this task.Oct 24 2013, 4:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 21 2015, 7:17 AM

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...

DatGuy added a subscriber: DatGuy.Jan 23 2017, 6:05 PM

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

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJan 23 2017, 6:05 PM

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

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

Aklapper updated the task description. (Show Details)Feb 22 2017, 12:30 PM
Aklapper removed a subscriber: wikibugs-l-list.
mmodell removed a subscriber: awight.Jun 22 2017, 9:39 PM
Krinkle raised the priority of this task from Normal to High.EditedOct 27 2018, 8:57 PM
Krinkle removed a project: good first bug.
Krinkle added a subscriber: Krinkle.

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.

Base added a subscriber: Base.Oct 27 2018, 11:45 PM