Page MenuHomePhabricator

Structured data - references can be published without property value
Closed, ResolvedPublic

Description

Can be tested on commons betalabs.

  1. On File page go to Structured data tab.
  2. Click on Add reference link and enter a valid Property, e.g. date retrieved. Add a valid values for the *date retrieved**.
  3. Remove the property value, e.g. remove date retrieved.

Screen Shot 2021-12-06 at 2.47.53 PM.png (868×1 px, 99 KB)

  1. "Publish changes" button is still active - click to publish it. The label Reference will be displayed.

Screen Shot 2021-12-06 at 2.28.02 PM.png (794×1 px, 125 KB)

After that when clicking on Edit

  • a user won't be giving an option to remove incomplete reference - no x button
  • "Add reference" is unresponsive

Screen Shot 2021-12-06 at 2.54.27 PM.png (1×1 px, 140 KB)

  • reloading a page/navigating away and returning
Expected behavior
  • a user should be prevented from publishing incomplete references
  • or a user should have an option to correct an error (the publishing incomplete reference) easily enough, e.g. by clicking on Edit and remove incorrect entries.

Event Timeline

I can't reproduce the issue ATM.
It looks similar to T297066, though, for which a fix just got merged.
I suspect it also resolved this bug.
Can you still reproduce this issue on your end?

I can't reproduce the issue ATM.
It looks similar to T297066, though, for which a fix just got merged.
I suspect it also resolved this bug.
Can you still reproduce this issue on your end?

Yes, I am still able to reproduce the issue. The main problem is that there is no validation checking for the Reference field.
You may check this video: https://drive.google.com/file/d/1Z7EBt5CEFlHPYlPF79SqVB1DTbBY7Oee/view?usp=sharing

The video shows

  • I entered one valid references (with the property value date of publication)
  • I entered another valid references (with the property value date retrieved)
  • I removed the property value date retrieved
  • I published

Two Reference labels are present, but one is empty:

Screen Shot 2021-12-07 at 12.39.38 PM.png (788×1 px, 191 KB)

  • clicking on Edit again does not allow me to remove the reference
  • reloading the page returns everything to normal.
NOTE: Qualifiers with empty property values behave correctly. Repeating the steps above for Qualifiers, would result in a correct behavior of not publishing the qualifier without a property value.

Change 745299 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/WikibaseMediaInfo@master] Discard empty references

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

Change 745300 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/WikibaseMediaInfo@master] Refactor node matching

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

Thanks, that video was very helpful & I managed to reproduce!

Two Reference labels are present, but one is empty

This should be fixed with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/745299

  • clicking on Edit again does not allow me to remove the reference

And that should be fixed with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/745300

Change 745299 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] Discard empty references

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

Change 745300 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] Refactor node matching

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

Etonkovidova claimed this task.

Checked on commons betalabs - works as expected:

  • the validation for the input is inplace, i.e. if the field is empty, the "Publish changes" button is inactive; the invalid input length is recognized and users will see the warning
  • if several references are entered and only some of them are blank, clicking on "Publish changes" will successfully discard empty/malformed input for references and published the valid ones.