thiemowmde added a comment.

  I'm sorry for my rude comment at https://gerrit.wikimedia.org/r/502530. I 
made that in a hurry.
  
  The two relevant lines of code are these:
  
  - 
https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/repo/includes/Specials/SpecialSetAliases.php$82
 does an `implode()`.
  - 
https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/repo/includes/Specials/SpecialSetAliases.php$109
 does an `explode()`.
  
  Note that neither of these is wrong. The ability to enter multiple aliases 
separated with a pipe character is a documented feature of the special page 
<https://test.wikidata.org/wiki/Special:SetAliases>: //"Several aliases are 
separated by a pipe (|) character."// I would argue we are not really talking 
about a bug here, but about a missing feature that was forgotten in the design 
of the special page.
  
  Possible solutions I can think of:
  
  - Let the special page fail hard when one of the existing aliases the code is 
going to `implode()` already contains a pipe character. This is not really a 
solution, but prevents unintentional data loss.
  - Ask the user to escape pipe characters with a backslash when they aren't 
meant to be separation characters. Before doing the `implode()`, the code also 
adds backslashes to all `|` as well as `\` in the existing aliases. After the 
explode, these (but only these two) are removed. The biggest issue with this 
solution is that it is not user friendly, and introduces a new escaping rule 
that was (to my knowledge) never used in Wikibase before.
  - The most user friendly solution I can think of is to use the 
TagMultiselectWidget from #OOUI <https://phabricator.wikimedia.org/tag/ooui/>: 
https://doc.wikimedia.org/oojs-ui/master/demos/?page=widgets&theme=wikimediaui&direction=ltr&platform=desktop.
 The problem with this is that it does not work without JavaScript, but the 
main purpose of the special page is to provide a no-JS fallback. This 
effectively means this solution can not be used – except OOUI provides a no-JS 
alternative for this, which I think it doesn't, but I might miss something.
  - The special page can be redesigned to have one input field for each alias. 
At the end is an "add" button that reloads the special page (remember, it must 
work without JavaScript) and adds a new empty field for entering another alias. 
To make this easier for the user, the special page could always present 10 
input fields, and the "add" button always add 10 more. Empty ones and 
duplicates are ignored anyway (the special page does not even need to do 
anything for this, I believe the data model classes already take care of this).
  
  Whatever route you decide to go, to me it feels surprisingly expensive. I 
wonder why this task does not have any estimate, discussion, or investigation 
results?

TASK DETAIL
  https://phabricator.wikimedia.org/T219499

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Greta_Doci_WMDE, thiemowmde
Cc: thiemowmde, Greta_Doci_WMDE, Tarrow, Addshore, Aklapper, alaa_wmde, 
joker88john, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, 
Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, 
Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, 
Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, _jensen, 
rosalieper, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to