-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Template Parts: Fix theme slug injection for patterns #5450
Conversation
Good catch, thank you both! I'll try to write a quick unit test to cover the |
For book-keeping, we should probably file a Trac ticket for this (since it needs to go into 6.4 Beta 3, and we're fairly late in the cycle). Would either of you mind doing so? Probably enough to basically copy-paste WordPress/gutenberg#55202. Otherwise I can take care of that once I have the unit test ready. |
Verify that this covers the regression by cherry-picking the commit to I'll add another test to cover |
/** | ||
* Should insert a theme attribute into Template Part blocks in registered patterns. | ||
* | ||
* @ticket XXXXX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD
Going to file the ticket so I can put the corred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes look good. New unit tests were added to cover the regression discovered. Let's ensure that all unit tests pass on CI.
Looking good. Thanks all, I'll land it 😊 |
Committed to Core in https://core.trac.wordpress.org/changeset/56818. |
Fixes: WordPress/gutenberg#55202
Trac ticket: https://core.trac.wordpress.org/ticket/59583
This ensures that the theme slug is correctly inserted into template parts that are inside patterns.
Furthermore, unit tests are added to prevent the same kind of regression in the future. The tests can be used to verify the fix: Cherry-pick 3cb17f8 and d077949 to
trunk
, runnpm run test:php -- --group=blocks
, and verify that it fails. Compare that to this branch where those tests pass (see CI, or test locally).Props @gziolo for finding the problem
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.