Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gdelavil opened this issue May 17, 2021 · 2 comments
Open

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

gdelavil opened this issue May 17, 2021 · 2 comments
Labels

Comments

@gdelavil
Copy link

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
@NightJar
Copy link
Contributor

This is probably an issue with https://github.com/silverstripe/silverstripe-versioned-admin - I'll transfer the issue there.
Thanks for reporting this so accurately @gdelavil :)

@NightJar NightJar transferred this issue from silverstripe/silverstripe-framework May 17, 2021
@gdelavil
Copy link
Author

Thanks @NightJar ! Credit goes to @ahaleisha for finding it in our project in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants