Skip to content

[5.x]: 404 when viewing drafts #17157

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

Closed
mmikkel opened this issue Apr 23, 2025 · 1 comment
Closed

[5.x]: 404 when viewing drafts #17157

mmikkel opened this issue Apr 23, 2025 · 1 comment
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Apr 23, 2025

What happened?

Description

When clicking the "View" button from a draft's edit page, Craft will open a new tab with a URL that looks like this:

https://craft5.ddev.site/index.php?p=admin/actions/preview/create-token&site=default&elementType=craft\elements\Entry&canonicalId=394&siteId=2&revisionId=&previewToken=C0JI82ewYg8ENG5zNG-fifHv4-o-Zpq5&redirect=https://craft5.ddev.site/news/another-entry?x-craft-preview=094cfacea0c5e4cfa606622ad78cab1095e8f61078d6e8a52fc64a985a9ff101bmocqbdcit&token=C0JI82ewYg8ENG5zNG-fifHv4-o-Zpq5

...which throws a 404.

Closing the tab and clicking the View button a second time opens the new tab with the proper URL (i.e. no 404).

This also affects Craft 4.15.1.

Steps to reproduce

  1. Edit an existing entry so it becomes a provisional draft
  2. Click the "View" button; a new tab opens with the URL /admin/actions/preview/create-token and a 404 status
  3. Close the tab and click the "View" button again. The new tab now uses the proper entry URL and does not 404

Expected behavior

Actual behavior

Craft CMS version

5.7.2, 4.15.1

PHP version

8.2.28

Operating system and version

macOS 14.6.1, MS Edge 135.0.3179.54, DDEV v1.24.4

Database type and version

MySQL 8.0.40

Image driver and version

No response

Installed plugins and versions

None

@brandonkelly
Copy link
Member

Thanks for reporting that! Craft 4.15.2 and 5.7.3 are out with a fix.

@i-just i-just mentioned this issue May 14, 2025
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

2 participants