Changes made to a draft with REST API won't take effect on the editor

XMLWordPrintable

    • 4
    • Severity 3 - Minor
    • 4

      Issue Summary

      When updating a draft using the REST API (PUT /wiki/rest/api/content/{id}?status=draft), the draft's body.storage will be updated but those changes won't take effect on the editor.

      When the page is edited through the UI, the old contents are shown.

      Steps to Reproduce

      1. Create a page and copy its ID
      2. Perform the following request (replace the PAGE_ID and the INSTACE_URL)
        fetch("https://INSTACE_URL/wiki/rest/api/content/450953226?status=draft", {
            "headers": {
                "content-type": "application/json",
            },
            "body": "{\"version\":{\"number\":1},\"type\":\"page\",\"status\":\"draft\",\"title\":\"Page title - updated through API\",\"body\":{\"storage\": {\"value\": \"<p>Test draft</p>\",\"representation\": \"storage\"}}}",
            "method": "PUT",
        })
      1. Edit the page through the UI

      Expected Results

      The draft should contain "Test draft"

      Actual Results

      The draft still shows the old contents

      Workaround

      Currently, the only available workaround is to force the draft to refresh through the following request after the update:

      fetch("https://INSTANCE_URL/wiki/rest/synchrony/1.0/content/PAGE_ID/recovery?behind=SYNCHRONY", {
        "headers": {
          "accept": "*/*",
        },
        "body": null,
        "method": "PUT"
      });

              Assignee:
              Niraj
              Reporter:
              Guilherme T (Inactive)
              Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: