-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Patterns: check that pattern is synced before replacing blocks with synced pattern on creation #54804
Conversation
…h a synced pattern
Size Change: +5 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
Flaky tests detected in e18e48d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6304838591
|
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.
- I can create unsynced and synced patterns in the Post and Site editors, both are available in the Block inserter menu
- Exporting and importing unsynced and synced patterns works in the site editor
LGTM
Looks like there is a fix for the failing unit tests here - will rebase once that is merged. |
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.
Thanks for the rapid turnaround in fixing this @glendaviesnz 👍
✅ Post Editor: Creation of unsynced and synced patterns works as expected
✅ Site Editor: Creation of unsynced and synced patterns continues to function
✅ Import/Export: Works as before also
This is a reasonably critical fix that should be in the 6.4 Beta, and we are reasonably confident that it is not the cause of the current test failures, which are discussed here and here, so going to go ahead and merge so there is no hold up with getting this into 17.6 and beta. It is a reasonably small change so should be easy to follow up if any issues we have overlooked. |
…h a synced pattern (#54804)
I just cherry-picked this PR to the release/16.7 branch to get it included in the next release: fb8ffc9 |
…h a synced pattern (#54804)
* use the wporg cdn (#54795) * core-data: Fix nested property access with undefined name (#54790) * core-data: Fix nested property access with undefined name * Add a unit test * Social Links: add X (#54092) * Social Links: add X Fixes #53223 * Add Twitter keyword to variation This will allow people to find the new icon when searching for Twitter. See #53223 (comment) * Reorder links alphabetically Co-authored-by: Aki Hamano <[email protected]> * No need for a capital letter Co-authored-by: Aki Hamano <[email protected]> * Fix svg attributes See #54092 (comment) Co-authored-by: Rich Tabor <[email protected]> * Remove "icon" Co-authored-by: Nick Diego <[email protected]> * Update X icon path See #54092 (comment) See #54092 (comment) --------- Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Rich Tabor <[email protected]> Co-authored-by: Nick Diego <[email protected]> * remove font files created by tests after tests run (#54771) * Check that new pattern is synced before replacing existing blocks with a synced pattern (#54804) * Patterns: Improve sentence case consistency of labels and notices (#54807) * Navigation block: fix padding on mobile overlay when global padding is 0 (#53725) * force min value for padding to be 2rem * fallback for when the css variables are not defined * Allow the padding to be smaller than 2rem * Add fix to avoid trigger hover state on links when overlay opens --------- Co-authored-by: scruffian <[email protected]> Co-authored-by: Dave Smith <[email protected]> * Always show the total number of patterns even with only one page (#54813) * Always show the total number of patterns even with only one page * Add to explorer too * Hide total number of 0 * Font Library: Avoid rendering Font Library UI outside Gutenberg plugin (#54830) * Remove action to fix tests. (#54806) * Conditionally remove deprecated 'print_emoji_styles' (#54828) * Fix Performance tests * Fix global styles revision --------- Co-authored-by: Matias Benedetto <[email protected]> Co-authored-by: Marin Atanasov <[email protected]> Co-authored-by: Jeremy Herve <[email protected]> Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Rich Tabor <[email protected]> Co-authored-by: Nick Diego <[email protected]> Co-authored-by: Glen Davies <[email protected]> Co-authored-by: Aaron Robertshaw <[email protected]> Co-authored-by: Maggie <[email protected]> Co-authored-by: scruffian <[email protected]> Co-authored-by: Dave Smith <[email protected]> Co-authored-by: Kai Hao <[email protected]> Co-authored-by: Jonny Harris <[email protected]> Co-authored-by: George Mamadashvili <[email protected]>
What?
Adds a check to the pattern creation code to make sure the new pattern is synced before replacing the existing blocks in the editor canvas.
Why?
After a change in the pattern creation modal to account for the import/export of patterns via JSON new unsynced patterns are initially being inserted into the post editor canvas as synced even though they entity is successfully saved as unsynced.
Fixes: #54803
How?
Adds a check in the create pattern button success method to only replace the blocks in the editor canvas if the new pattern is not unsynced.
Testing Instructions
Create pattern
Screenshots or screencast
Before:
unsynced-issue-before.mp4
After:
unsynced-issue.mp4