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 added a subscriber: Lokal_Profil.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 19 2015, 9:50 AM
Lydia_Pintscher triaged this task as Medium priority.May 19 2015, 1:49 PM
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

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptDec 19 2017, 3:52 PM

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

Kizule moved this task from Backlog to Doing on the good first task board.Jan 31 2018, 3:56 PM
Addshore closed this task as Resolved.Sep 18 2018, 12:12 PM
Addshore assigned this task to thiemowmde.
Addshore moved this task from ready to go to in progress on the Wikidata board.
Addshore added a subscriber: Addshore.

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!