Last modified: 2013-05-08 11:39:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46547, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44547 - (backend/api) Can not add reference to existing statement when any statement's reference got added/edited in the meantime
(backend/api) Can not add reference to existing statement when any statement'...
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized major (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-31 13:27 UTC by Daniel A. R. Werner
Modified: 2013-05-08 11:39 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel A. R. Werner 2013-01-31 13:27:37 UTC
Two users load the same page, user A will finish loading before user B, user B will add a reference to any statement, the reference gets saved. Now user A will send his change of an existing reference or will try to add a new reference and sends the change to the API, but this will fail with the message "Failed to save the change". Only a reload will allow user A to do his edit.

User A can still add a new Statement and then add a new reference for that statement (since for creating that reference, the base rev id received after creation of the new statement was done is being used).
Comment 1 Daniel A. R. Werner 2013-01-31 14:05:46 UTC
Actually, user B might have a problem as well after adding/editing a Statement's reference.
After that change, all other Statement's references can not be edited and no new ones can be added for those.
Comment 2 tobias.gritschacher 2013-02-27 13:36:02 UTC
Tried the following example:
* I have an item with 2 claims: claim A and claim B which both have a reference
* I change the reference of claim A
* I try to change the reference of claim B (without reloading the page): this fails

What happens:
* the request fails, because EditEntity::fixEditConflict() returns false in line 481.
* of course the problem lies deeper, so I tracked it down a bit more
* in line 468 of EditEntity::fixEditConflict() $patchedCurrent seems to contain wrong data: Claim B still has the old reference although it should have been patched with the Diff between the baseContent and the newContent (which still is correct - line 458).
* consequently this leads to the case where the currentContent and the patched currentContent are the same and diffing them results in an empty diff which then leads to the patch collapsing.
* going even further, in line 855 of Entity::patch() both parameters (array of claims of current content & the claimsDiff) seem to be correct, so I assume the problem might be somewhere deeper in the MapPatcher of the Diff extension
Comment 3 tobias.gritschacher 2013-02-27 13:59:08 UTC
It runs into line 130 in MapPatcher::getPatchedMap(): "Cannot do a non-add operation with an element not present in a map."
Comment 4 tobias.gritschacher 2013-04-26 15:33:02 UTC
related changesets:
for wikibase: https://gerrit.wikimedia.org/r/#/c/60872/
for diff: https://gerrit.wikimedia.org/r/#/c/60870/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links