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

Previewing single post changes frontend doesn't work on block based themes #37463

Closed
walbo opened this issue Dec 16, 2021 · 2 comments · Fixed by #37622
Closed

Previewing single post changes frontend doesn't work on block based themes #37463

walbo opened this issue Dec 16, 2021 · 2 comments · Fixed by #37622
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@walbo
Copy link
Member

walbo commented Dec 16, 2021

Description

The preview functionality on block based themes doesn't work.

Inspecting on the editor page console, I do see a successful autosave fire right when the new tab opens, but somehow the preview isn't using the autosave data.

The preview works fine on non block bases themes (tested twentytwentyone).

Related core ticket: https://core.trac.wordpress.org/ticket/54635

Step-by-step reproduction instructions

  1. Activate a block based theme. Ex twentytwentytwo
  2. Make some changes to a post/page (without saving)
  3. Click on Preview
  4. Click on Preview in new tab
  5. Confirm that you changes isn't in the preview

Screenshots, screen recording, code snippet

No response

Environment info

Same bug in both WordPress 5.9 beta 3 (without Gutenberg) and in Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@walbo walbo added the [Type] Bug An existing feature does not function as intended label Dec 16, 2021
@hellofromtonya hellofromtonya added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 16, 2021
@adamsilverstein
Copy link
Member

I verified the same problem with another block theme ("Alara") to verify the issue wasn't twentytwentytwo specific.

@walbo walbo assigned walbo and unassigned walbo Dec 16, 2021
@adamsilverstein
Copy link
Member

I spent some time digging into this. I found that in this check https://github.com/WordPress/wordpress-develop/blob/954e9c153fe9d1b4f74d76bab9dd5175fd36cebc/src/wp-includes/class-wp-query.php#L3205
The call to current_user_can winds up breaking the review (even though it returns true). removing that check, the preview works fine. Still not sure why, these are my findings so far.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 24, 2021
@youknowriad youknowriad removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants