Troubleshooting · Developer docs

Troubleshooting

Grouped by symptom, never by module, because the person with the problem does not know which module has it. One hundred questions across ten pages, each answered with the causes in the order they usually turn out to be true.

Answer API requests

A multiselect area answers 422 "Unexpected associative array encountered"

A multiselect area is stored as text, so it takes its chosen keys as a JSON-encoded string, not as an array. It reads back as that same string in areasContent; areaValues(name) gives you the list.

JavaScript
"areaContent(colours)": ["red", "blue"]          // 422 Unexpected associative array encountered
"areaContent(colours)": "[\"red\",\"blue\"]"     // stored

// in code
body.patchRevision['areaContent(colours)'] = JSON.stringify(['red', 'blue']);

// reading it as a list
// ?properties={id,colours:areaValues(colours)}

The value each input type takes, and how it reads back, is in Writing areas. On custom entity records area values are not validated, so a wrong key is saved rather than refused.

In the API reference: Edit a page.

More in API requests

  1. Custom fields look lost after a write
  2. "Could not find the referenced record with id 0"
  3. A custom URL is set after creating the record, and cleared with an empty string
  4. My DELETE timed out: did it go through?
  5. My OAuth token stopped working after four hours: 403 "Token doesn't exist or is not valid"

Was this page helpful?

Your answer goes to the docs team.