Skip to content

404 when viewing "Unpublished" state in the SiteTree history #211

@gdelavil

Description

@gdelavil

Affected Version

4.7.2 (tested on the Silverstripe demo as well)

Description

When viewing the history of a page and clicking on a state with status Unpublished, the History view hangs (not the whole CMS though, it's still possible to navigate to other pages in the site tree) and the console shows a 404 error. This does not happen for either Saved or Published states.

Unsuccessfully viewing an Unpublished state:
Screen Shot 2021-05-18 at 11 14 54 AM

Successfully viewing a Published state:
Screen Shot 2021-05-18 at 11 17 42 AM

Successfully viewing Saved states, before and after unpublishing:
Screen Shot 2021-05-18 at 11 14 37 AM
Screen Shot 2021-05-18 at 11 14 31 AM

I've checked on Slack and I've searched through the existing issues, but this one doesn't seem to have been reported yet.

Steps to Reproduce

  1. Create a page
  2. Publish it
  3. Unpublish
  4. Go to History of the page
  5. Click on "Unpublished"

A request that looks like https://demo.silverstripe.org/admin/historyviewer/schema/versionForm/7206?RecordVersion=7&RecordClass=Page&RecordID=7206 will return the error {"status":"error","errors":[{"type":"error","code":404}]} (Note that this page will no longer exist, as the Silverstripe demo clears test pages periodically. This issue has been originally found on our code, and we only used the demo page to discard it being a project programming error).

Full request cURL:

curl 'https://demo.silverstripe.org/admin/historyviewer/schema/versionForm/7206?RecordVersion=7&RecordClass=Page&RecordID=7206' \
  -H 'authority: demo.silverstripe.org' \
  -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"' \
  -H 'accept: application/json' \
  -H 'x-formschema-request: auto,schema,state,errors' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36' \
  -H 'sec-fetch-site: same-origin' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://demo.silverstripe.org/admin/pages/history/show/7206' \
  -H 'accept-language: en-US,en;q=0.9,es;q=0.8,de;q=0.7' \
  -H 'cookie: _ga=GA1.2.122918073.1574992122; intercom-id-c1f8j5ci=75c63a75-85bd-4725-ba27-845bd5e4f2be; __qca=P0-395498613-1610331934619; __cfduid=d726235b256462655c126c233bc127d8d1619999348; _gid=GA1.2.1363369032.1621202636; intercom-session-c1f8j5ci=; PHPSESSID=td2f2rbr7gkn8v1mu6fcr09pi1; _gat=1' \
  --compressed

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions