Last modified: 2014-10-13 14:28:40 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 T59768, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57768 - action=wbeditentity: Missing datavalue key for snaks should raise a more specified message
action=wbeditentity: Missing datavalue key for snaks should raise a more spec...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
: testme
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-30 13:36 UTC by db [inactive,noenotif]
Modified: 2014-10-13 14:28 UTC (History)
6 users (show)

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


Attachments

Description db [inactive,noenotif] 2013-11-30 13:36:38 UTC
When a json for action=wbeditentity contains a snak, but that snak has no datavalue key the following error is given:

{code=internal_api_error_InvalidArgumentException, info=Exception Caught: Wikibase\SnakObject::newFromType got an array with to few constructor arguments}

The validation of the json should give a better error here to see the cause of the exception, instead of looking at the source.
Comment 1 Addshore 2014-01-11 19:57:00 UTC
Could you provide some params that when passed to the api reproduce this?
Comment 2 db [inactive,noenotif] 2014-01-11 21:13:57 UTC
Be creative: {"claims":[{"type":"statement","mainsnak":{"snaktype":"value","property":"P1"},"rank":"normal"}]}
for an existing item.

Only remove the datavalue from the input. There are maybe more possible combination, all should result in a proper error message and not in an api internal error. Maybe along to ::newFromType a ::isValidInput/::canCreateTypeFromInput or so is needed to do this, which calls internal the same stack than the type would do.

When catching the internal error there is no way to know the missing json key, which would be a nice information for the client.

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


Navigation
Links