Page MenuHomePhabricator

`usergroups` field label entity-encoded twice in Special:Preferences
Open, NormalPublic

Description

Steps to Reproduce:

  1. Go to https://fr.wikipedia.org
  2. Make sure that you are logged in (and that the current interface language is set to fr – français)
  3. Look at the usergroups field label on the Special:Preferences page

Actual Results: The label says "Membre des groupes :" (sic)

Expected Results: The label should say "Membre des groupes :" (with a non-breakable space before the colon).

Possible Cause: Inside Preferences:: profilePreferences() method, the parse()-ed message MediaWiki:prefs-memberingroups is filled in the label member of $defaultPreferences['usergroups'] instead of label-raw, causing a second entity-escaping to occur in HTMLFormField::__construct().

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 12 2016, 10:55 PM
Od1n triaged this task as Normal priority.Aug 23 2016, 7:53 AM
Od1n added a project: good first bug.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptAug 23 2016, 7:53 AM
Od1n added a subscriber: Od1n.Aug 23 2016, 7:54 AM
Od1n added a comment.Sep 28 2016, 2:38 AM

The translation[1] has been edited so currently you can't see the issue in the preferences[2], though it still exists.

[1] https://translatewiki.net/wiki/MediaWiki:Prefs-memberingroups/fr
[2] https://en.wikipedia.org/wiki/Special:Preferences?uselang=fr

Change 320156 had a related patch set uploaded (by Pmlineditor):
Prevent double escaping of 'usergroups' field label in Preferences

https://gerrit.wikimedia.org/r/320156

Framawiki moved this task from Backlog to Doing on the good first bug board.Dec 2 2017, 1:32 PM

Change 320156 abandoned by Pmlineditor:
Prevent double escaping of 'usergroups' field label in Preferences

https://gerrit.wikimedia.org/r/320156

Umherirrender closed this task as Resolved.Sep 18 2018, 6:55 PM
Umherirrender added a subscriber: Umherirrender.

It works for me now.

The message is 'prefs-memberingroups'

Framawiki reopened this task as Open.Dec 2 2018, 9:22 PM
Framawiki added subscribers: Nikerabbit, Bastenbas, Framawiki.

A user reported to me that the problem is still present. See https://fr.wikipedia.org/wiki/Special:Preferences?uselang=fr.
Screenshot: https://framapic.org/xnXHmZf2N1u2/vONVEHJEe3rG.png (yay hosted on framacorp website)
No local message overwrite exists: https://fr.wikipedia.org/wiki/MediaWiki:Prefs-memberingroups

Od1n added a comment.Dec 3 2018, 3:52 AM

Note that previously the preferences had been fixed, by using in the message a nbsp character (instead of a html entity), and it was working fine.

Recently the   appeared back in the preferences, and I have tried to fix this by just replacing the nbsp character with a regular space. Apparently it didn't work, as the   is still present.

My guess is that the bug is produced in two steps:

  • First, mediawiki automatically replaces the regular space with a nbsp entity (French typography rule)
  • Then, this entity is unexpectedly escaped

The logical thing to do would be to not parse this message. But I am afraid there will be local customizations that expect that.

Pols12 added a subscriber: Pols12.Jan 13 2019, 3:28 PM