Page MenuHomePhabricator

HTML 'id' values should be unique in Wikidata lexeme pages
Closed, ResolvedPublic5 Estimated Story Points

Description

Problem:
Statements on Lexeme pages are identified with the HTML attribute id, whose values are the corresponding property IDs. This can lead to multiple HTML elements with the same id, since the same property can be used on the Lexeme level, in each Form and later also Sense. However, the id value must be unique within the HTML document. It also causes issues when you use it as a link fragment to link to a specific statement group.

Example:

forms-L2.png (791×830 px, 39 KB)

BDD
GIVEN I am on a Lexeme
AND the Form F1 has a statement using property P123
THEN the statement group for F1 has an HTML id "F1-P123"

Acceptance criteria:

  • Statement groups in Forms have the Form ID added to their statement group ID
  • Statement groups on the Lexeme level as well as on items and properties continue to have only the property ID in their statement group ID

Info

  • The use of the property id as HTML id attribute is hard-wired into the respective jquery ui widget (view/resources/jquery/wikibase/jquery.wikibase.statementgroupview.js) and the widget's value gets used (this.options.value.getKey() line 92 _updateId) - an (optional) prefix is not supported at the moment
  • validate resulting html
    • e.g. using selenium: add a dedicated test that creates a fleshed out lexeme with multiple statements, forms etc and asserts that the HTML ids are unique
    • somehow get the diagnose data of the mw tidy

Event Timeline

Vvjjkkii renamed this task from HTML 'id' values should be unique in Wikidata lexeme pages to lsbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
CommunityTechBot renamed this task from lsbaaaaaaa to HTML 'id' values should be unique in Wikidata lexeme pages.Jul 2 2018, 1:12 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)

It seems right to me. I'll keep this format in mind for future tasks. :-)

Jakob_WMDE set the point value for this task to 5.Jul 24 2018, 12:18 PM

Column move was wishful thinking - confusion with this id change.

Change 459806 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Add optional html id prefix to statement groups

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

Change 459810 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Add form id prefix to form statement groups

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

Change 460379 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Add html data attribute to statement groups for js hydration

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

Change 459806 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add optional html id prefix to statement groups

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

Change 460379 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add html data attribute to statement groups for dom hydration

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

Change 459810 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Add form id prefix to form statement groups

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

@Lydia_Pintscher We likely need a ticket for the sense part of this so it is not forgotten (casually mentioned in the description, but when this was written senses were not a thing yet). => T205079

As discussed with Pablo the ID is now "L1-F2-P3" instead of "F2-P3" as described in the BDD. We should change it.

Change 462910 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] subentity statement groups: ids without lexeme part

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

Change 463050 had a related patch set uploaded (by Tarrow; owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@wmf/1.32.0-wmf.23] form statement groups: ids without lexeme part

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

Change 462910 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] form statement groups: ids without lexeme part

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

Change 463060 had a related patch set uploaded (by Tarrow; owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@wmf/1.32.0-wmf.22] form statement groups: ids without lexeme part

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

Change 463060 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@wmf/1.32.0-wmf.22] form statement groups: ids without lexeme part

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

Change 463050 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@wmf/1.32.0-wmf.23] form statement groups: ids without lexeme part

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

Mentioned in SAL (#wikimedia-operations) [2018-09-26T15:53:08Z] <addshore@deploy1001> Synchronized php-1.32.0-wmf.23/extensions/WikibaseLexeme: [[gerrit:463050|form statement groups: ids without lexeme part]] T196226 (duration: 01m 06s)

Mentioned in SAL (#wikimedia-operations) [2018-09-26T15:55:04Z] <addshore@deploy1001> Synchronized php-1.32.0-wmf.22/extensions/WikibaseLexeme: [[gerrit:463060|form statement groups: ids without lexeme part]] T196226 (duration: 01m 01s)