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

My patch changed the wrong section, with no error

The collection's positions had drifted. Removing an element from a component collection does not renumber the ones after it, and a position you send is matched against the stored positions. On a collection A, B, C, D, removing 2 leaves A, C, D stored as 1, 3, 4; a later "remove 3", "patch 3" or "replace 3" then acts on C, the second element shown, and answers 200. The read shape has no positions, so a client cannot see the drift.

Appending and inserting are safe. To reorder, remove or change an element on a collection whose history you do not know, read it, change the list in your code, and write it back whole with areaContent(name), which also renumbers it.

The script is in Add, reorder or remove a section on many pages; every collection key is in Editing component collections.

In the API reference: Remove elements.

More in API requests

  1. A multiselect area answers 422 "Unexpected associative array encountered"
  2. Custom fields look lost after a write
  3. "Could not find the referenced record with id 0"
  4. A custom URL is set after creating the record, and cleared with an empty string
  5. My DELETE timed out: did it go through?

Was this page helpful?

Your answer goes to the docs team.