If I give the api (e.g. CreateClaim) an invalid value for geocoordinate, it does not get validated. Instead it fails hard with a fatal error, which gets returned back to me, the bot / api user as a stack trace and obviously gets logged.
I am told that the same error is appearing in the production fatal logs, therefore if there is a reasonable way that we can patch it, we should and backport it asap.
A more overall approach to better value validation, as described in bug 49263, is needed soon as possible though would be too drastic of a change for backporting.
PHP Catchable fatal error: Argument 1 passed to DataValues\\GeoCoordinateValue::newFromArray() must be an array, null given, called in /var/www/common/wikibase-repo/extensions/DataValues/DataValues/includes/DataValueFactory.php on line 102 and defined in /var/www/common/wikibase-repo/extensions/DataValues/DataValues/includes/values/GeoCoordinateValue.php on line 281
PHP Stack trace:
PHP 1. {main}() /var/www/common/wikibase-repo/api.php:0
PHP 2. ApiMain->execute() /var/www/common/wikibase-repo/api.php:73
PHP 3. ApiMain->executeActionWithErrorHandling() /var/www/common/wikibase-repo/includes/api/ApiMain.php:351
PHP 4. ApiMain->executeAction() /var/www/common/wikibase-repo/includes/api/ApiMain.php:380
PHP 5. Wikibase\\Api\\CreateClaim->execute() /var/www/common/wikibase-repo/includes/api/ApiMain.php:840
PHP 6. Wikibase\\Api\\CreateClaim->getSnakInstance() /var/www/common/wikibase-repo/extensions/Wikibase/repo/includes/api/CreateClaim.php:67
PHP 7. Wikibase\\SnakFactory->newSnak() /var/www/common/wikibase-repo/extensions/Wikibase/repo/includes/api/CreateClaim.php:190
PHP 8. Wikibase\\PropertyValueSnak::newFromPropertyValue() /var/www/common/wikibase-repo/extensions/Wikibase/DataModel/DataModel/Snak/SnakFactory.php:53
PHP 9. Wikibase\\Property->newDataValue() /var/www/common/wikibase-repo/extensions/Wikibase/DataModel/DataModel/Snak/PropertyValueSnak.php:151
PHP 10. DataValues\\DataValueFactory->newDataValue() /var/www/common/wikibase-repo/extensions/Wikibase/DataModel/DataModel/Entity/Property.php:177
PHP 11. DataValues\\GeoCoordinateValue::newFromArray() /var/www/common/wikibase-repo/extensions/DataValues/DataValues/includes/DataValueFactory.php:102
Depending on what I feed the api, am also able to get:
PHP Catchable fatal error: Argument 1 passed to DataValues\\GeoCoordinateValue::newFromArray() must be an array, string given, called in /var/www/common/wikibase-repo/extensions/DataValues/DataValues/includes/DataValueFactory.php on line 102 and defined in /var/www/common/wikibase-repo/extensions/DataValues/DataValues/includes/values/GeoCoordinateValue.php on line 281
Version: master
Severity: normal