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

[WP6.2] Wide and full alignments are lost on the page using a custom template when switching block themes #48355

Closed
mayuge3 opened this issue Feb 23, 2023 · 4 comments · Fixed by #48386
Labels
[Type] Bug An existing feature does not function as intended

Comments

@mayuge3
Copy link

mayuge3 commented Feb 23, 2023

Description

When I switch the active block theme, wide and full alignments are lost on the page using a custom template.

Maybe related to #48074 and #47477, but this also happens with default block themes such as TT2 and TT3.

Tested with WordPress 6.2 beta3 nightly.
Same result with/without Gutenberg plugin 15.2.

Step-by-step reproduction instructions

  1. Use TT2 theme, create a new page and set its template to "Page (Large Header)"
  2. Add blocks and set its alignment to wide or full.
  3. Switch active theme to TT3. Then, the template of this page is automatically set to "Default" and wide/full alignments are lost.

Screenshots, screen recording, code snippet

Before switching theme (TT2) Template
01-tt2 01-tt2-custom
After switching theme (TT3) Template
02-tt3 02-tt3-custom

However, wide/full alignments are back if I change the template after switching theme:

Change template after switching theme (TT3) Template
03-tt3 03-tt3-custom

Environment info

WordPress 6.2-beta3-55409 (latest nightly), instawp install
TT2 and TT3 included in nightly
Tested with and without Gutenberg plugin 15.2

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

@tomdevisser tomdevisser added the [Type] Bug An existing feature does not function as intended label Feb 23, 2023
@tomdevisser
Copy link
Member

Thanks for submitting the ticket @mayuge3. I can reproduce this bug on my end. I also want to point out this was working fine on 6.1.1, so this is indeed a new bug.

I also want to specify, the full width option doesn't even show on the first load in this template, but it does once switching, taking me to another thing I noticed.

Screenshot 2023-02-23 at 2 59 25 PM

Screenshot 2023-02-23 at 2 59 07 PM

It might be unrelated to this bug (as this also happens in 6.1.1), but related to this subject, there seems to be something wrong with the Template label as well upon switching, it goes from Default Template to Page.

template.switching.mov

@tellthemachines
Copy link
Contributor

I can reproduce this issue on trunk, and @andrewserong already has a fix for it in #48386!

@andrewserong
Copy link
Contributor

The close the loop on this one — it appears the issue was that after switching themes, the currently set custom template is no longer available in the new theme, so the post editor was unable to retrieve the post content block from the current template, to determine which layout/alignment controls to display. It turns out there was a bug in the fallback logic for the layout/alignment rules, which should be resolved now that #48386 has landed.

If the issue recurs, feel free to reopen this issue! 🙂

@mayuge3
Copy link
Author

mayuge3 commented Mar 2, 2023

Alighments work in 6.2-beta4-55454 and Gutenberg plugin 15.2.4.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants