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

Updating one area emptied the others

The write used revisions, which builds a whole new revision from what the request sends: every layout area left out is empty in it. To change one area and keep the rest, use patchRevision, which copies a revision and changes only the keys you send, and name the area with areaContent(name). Send originRevision with the live revision's id: without it the copy is taken from the newest revision, which may not be the live one.

A top-level areaContent(name), outside any revision object, is no help either: it answers success and changes nothing.

HTTP A real answer on this documentation site's sandbox page
PUT /cdna-api/pages/page/1885?properties={id,activeRevision{id}}
Content-Type: application/json

{
  "patchRevision": {
    "originRevision": 3482,
    "activeRevision": true,
    "areaContent(navSection)": "devdocs"
  }
}

# 200 {"id": 1885, "activeRevision": {"id": 3483}}: navSection changed, the five sections kept

If the layout areas were lost already, make the revision before the write live again by its id: see Roll back a page to an earlier revision. The steps are in Change one area of a page without touching the rest.

In the API reference: Edit a page.

More in API requests

  1. My patch changed the wrong section, with no error
  2. A multiselect area answers 422 "Unexpected associative array encountered"
  3. Custom fields look lost after a write
  4. "Could not find the referenced record with id 0"
  5. A custom URL is set after creating the record, and cleared with an empty string

Was this page helpful?

Your answer goes to the docs team.