Last modified: 2014-01-22 15:31:45 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 T60394, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58394 - "specified index out of bounds" issue when moving a statement
"specified index out of bounds" issue when moving a statement
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
master
All All
: Highest major (vote)
: ---
Assigned To: Wikidata bugs
backlog
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-12 15:05 UTC by Lydia Pintscher
Modified: 2014-01-22 15:31 UTC (History)
8 users (show)

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


Attachments

Description Lydia Pintscher 2013-12-12 15:05:26 UTC
There are certain scenarios when moving a statement in the UI results in an "specified index is out of bounds" error.

https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team#Exception_Caught:_Specified_index_is_out_of_bounds
Comment 1 Henning 2013-12-12 15:27:34 UTC
This occurs, for example, when adding three statements with a property not yet featured by the item.
The UI sends the correct information, although the baseRevId sent along with the request is, of course, the one received when the item was loaded since that one is not updated by the "add statement" operation.
When the entity content is loaded in the SetClaim module, the initial set of claims/statements as to the baseRevId is loaded and passed to ChangeOpClaim. Consequently, the statements just added are missing and the index where to place the statements within the flat list of statements is wrong because the statements previously added are not detected being in the list of statements.
Comment 2 Maarten Dammers 2013-12-23 21:28:51 UTC
I've seen this happen plenty (10+) times. How to reproduce:
* Add a new claim (new property) to a page
* Add a second claim with the same property
* Try to add a third claim to the same property -> POOF
Comment 3 Magnus Manske 2014-01-09 19:15:55 UTC
For completeness' sake, it can happen for the second claim already.
Comment 4 Addshore 2014-01-20 12:16:14 UTC
Exception Caught: Specified index is out of bounds"

#0 extensions\Wikibase\vendor\wikibase\data-model\src\Wikibase\DataModel\ByPropertyIdArray.php(432): Wikibase\DataModel\ByPropertyIdArray->moveObjectToIndex(Object(Wikibase\DataModel\Claim\Statement), 3)
#1 extensions\Wikibase\repo\includes\ChangeOp\ChangeOpClaim.php(100): Wikibase\DataModel\ByPropertyIdArray->addObjectAtIndex(Object(Wikibase\DataModel\Claim\Statement), 3)
#2 extensions\Wikibase\repo\includes\api\SetClaim.php(64): Wikibase\ChangeOp\ChangeOpClaim->apply(Object(Wikibase\DataModel\Entity\Item))
#3 includes\api\ApiMain.php(861): Wikibase\Api\SetClaim->execute()
#4 includes\api\ApiMain.php(362): ApiMain->executeAction()
#5 includes\api\ApiMain.php(333): ApiMain->executeActionWithErrorHandling()
#6 api.php(76): ApiMain->execute()
#7 {main}~


Occours whenever the index submitted to wbsetclaim is 2 above the number of claims currently in the item for the baserevid that has been submitted.

i.e. 1 claim on item for baserevid 888 >> submit a new claim with index 3 >> Exception
Comment 5 Gerrit Notification Bot 2014-01-20 13:04:24 UTC
Change 108503 had a related patch set uploaded by Addshore:
Clean up error for claim index out of bounds

https://gerrit.wikimedia.org/r/108503
Comment 6 Gerrit Notification Bot 2014-01-20 15:50:44 UTC
Change 108527 had a related patch set uploaded by Addshore:
Implement hack to avoid UI throwing this error

https://gerrit.wikimedia.org/r/108527
Comment 7 Gerrit Notification Bot 2014-01-20 21:54:34 UTC
Change 108503 merged by Jeroen De Dauw:
Clean up error for claim index out of bounds

https://gerrit.wikimedia.org/r/108503
Comment 8 Gerrit Notification Bot 2014-01-21 13:07:23 UTC
Change 108672 had a related patch set uploaded by Addshore:
Clean up error for claim index out of bounds

https://gerrit.wikimedia.org/r/108672
Comment 9 Gerrit Notification Bot 2014-01-21 13:10:15 UTC
Change 108672 merged by jenkins-bot:
Clean up error for claim index out of bounds

https://gerrit.wikimedia.org/r/108672
Comment 10 Gerrit Notification Bot 2014-01-21 13:32:21 UTC
Change 108527 merged by jenkins-bot:
Implement hack to avoid UI throwing this error

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

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


Navigation
Links