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

TT1-Blocks: Update Query block in index template to use displayLayout instead of layout #293

Conversation

andrewserong
Copy link
Contributor

On a fresh install of Gutenberg, running in wp-env, I noticed that the current index.html template throws an error, due to the layout attribute being set to an invalid value (list):

This then throws an error in useAvailableAlignments at this line

image

This is because the layout attribute in this markup should be displayLayout, as layout is reserved for the Layout block support. The switch to displayLayout was introduced in WordPress/gutenberg#31833 (back in May).

It seems that this error occurs because for the current markup the layout attribute is being used directly in the Query block here — and because the current markup includes the container div, it never gets migrated via a deprecation (which usually handles the migration from layout to displayLayout).

Just to double-check before we do any further work in Gutenberg, @jorgefilipecosta it looks like this markup was last updated in #276 — do you remember if the updated markup was copy + pasted or hand-edited? Just trying to work out whether the markup here had a typo, or if we need additional deprecations in Gutenberg to handle this case?

Steps to test

With Gutenberg activated, go to create a new page and copy and paste the existing markup for the wp:query block from this file into the code editor view. You should see the error message in the screenshot above when you switch back to the visual editor.

Edit the markup in the code editor view and copy paste the change in this PR over the existing markup. When you switch back to the visual editor view, there should no longer be an error. Or, alternately, spin up a new WP instance and use this PR to load the TT1-Blocks theme. When you open the site editor, there should be no errors in the Query block.

@andrewserong
Copy link
Contributor Author

CC: @kjellr, too. I don't have access to add reviewers or labels to this repo 🙂

@carolinan
Copy link
Collaborator

carolinan commented Nov 23, 2021

Since the theme has not been updated since June I would expect there to be a large amount of compatibility issues.
I don't think anyone frankly has time to update the theme until after we are all rested after 5.9.

Since Twenty Twenty-Two will be the new theme that is tested with Gutenberg, can we prioritize making that change instead?

@carolinan
Copy link
Collaborator

While I can merge it, I don't know how to tag it as a new release, and I can't release it to .org.

@carolinan carolinan merged commit dff7d86 into WordPress:master Nov 23, 2021
@andrewserong
Copy link
Contributor Author

Thanks for merging @carolinan! And good to know that it's expected there'll be issues with TT1-Blocks until 11.9 comes out. I'll keep that in mind and focus more of my testing on TwentyTwentyTwo instead. Cheers!

@andrewserong andrewserong deleted the update/query-loop-markup-in-index-template-to-use-display-layout-attribute branch November 23, 2021 05:41
@andrewserong
Copy link
Contributor Author

As an aside, I just took a quick look at the TT2 templates and it looks like they don't have the same issue (the layout attribute in those templates appears to be set correctly) 👍

@carolinan
Copy link
Collaborator

With change, I meant, make sure that Gutenberg uses TT2 not tt1-blocks :) WordPress/twentytwentytwo#133

@jorgefilipecosta
Copy link
Member

Just to double-check before we do any further work in Gutenberg, @jorgefilipecosta it looks like this markup was last updated in #276 — do you remember if the updated markup was copy + pasted or hand-edited?

Hi @andrewserong, I'm sorry for the delay. The update was a mix of copy + paste and manual updates to reduce the diff.

@andrewserong
Copy link
Contributor Author

Perfect, thanks for confirming @jorgefilipecosta, just wanted to make sure I didn't need to investigate the block itself further in the Gutenberg repo, and that confirms it. Cheers! 🙇

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

Successfully merging this pull request may close these issues.

3 participants