Page MenuHomePhabricator

[Bug] Diff does not show stored capitalisation of first letter
Closed, ResolvedPublic

Description

If a filename/commonsMedia (and possibly other types) is added as a the value for a property but the initial letter is lower case then this is displayed as upper case in the interface but stored as lower case in the backend. Since the diff displays the value as shown, rather than as stored, the result is a diff which looks like it should have been a null edit.

As an example this diff changes fr-Japon.ogg to Fr-Japon.ogg but the diff makes it look like a null edit.

Suggestions:

  • Either have the diff display the stored value or
  • Capitalise first letter during initial storage (I'm guessing something similar is done to underscores already)

Event Timeline

Lokal_Profil raised the priority of this task from to Needs Triage.
Lokal_Profil updated the task description. (Show Details)
Lokal_Profil subscribed.
Lydia_Pintscher added a subscriber: daniel.
Jonas renamed this task from Diff does not show stored capitalisation of first letter to [Bug] Diff does not show stored capitalisation of first letter.Nov 2 2015, 3:45 PM
Jonas set Security to None.

Change 399203 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Wikibase@master] Remove link text normalization from CommonsLinkFormatter

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

In addition to what I already prepared in https://gerrit.wikimedia.org/r/399203, I suggest to add a CommonsMediaParser that enforces all normalization before the value is stored. This needs to happen in the file /var/www/mediawiki/core/extensions/Wikibase/repo/WikibaseRepo.datatypes.php, by adding a "parser-factory-callback" to the "PT:commonsMedia" datatype.

This parser will normalize new file names only. Old file names will remain unnormalized. That's why it's actually critical to have https://gerrit.wikimedia.org/r/399203, and stick to this basically forever (because unnormalized values might remain in the database forever).

Change 399203 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Remove link text normalization from CommonsLinkFormatter

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

In T99664#3848557I suggested to apply normalization to Wikimedia Commons file names before they are stored. This would solve a few related issues. Should I open a new ticket for this?

In T99664#3848557I suggested to apply normalization to Wikimedia Commons file names before they are stored. This would solve a few related issues. Should I open a new ticket for this?

Sounds like it could be a good idea to me!