Page MenuHomePhabricator

No usageexception thrown in api wbeditentities when using inconsistent languages
Closed, ResolvedPublic

Description

When using the below params with wbeditentity

'site' => 'enwiki', 'title' => 'Berlin' , 'data' => '{"labels":{"de":{"site":"pt","title":"TestString"}}}'

an undefined index of 'language' is thrown instead of a usage exception


Version: master
Severity: minor

Details

Reference
bz52731

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:06 AM
bzimport set Reference to bz52731.
bzimport added a subscriber: Unknown Object (MLST).

After a second look at the params this is because the json has 'labels' but then 'site' and 'title' rather than 'language' and 'value'.

This should still throw a usage exception though!

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

The error seems to be resolved now. (Is an error/usage exception now.)

{

  "servedby": "mw1017",
  "error": {
      "code": "not-recognized-string",
      "info": "A string was expected, but not recognized (A string was expected, but not found in the json for the langCode de and argument 'language')",
      "messages": [
          {
              "name": "wikibase-api-not-recognized-string",
              "parameters": [],
              "html": {
                  "*": "A string was expected, but not recognized"
              }
          }
      ],
      "*": "See https://test.wikidata.org/w/api.php for API usage"
  }
}
Lucie set Security to None.