Fix md5 class messed up with new block key#52557
Conversation
|
Flaky tests detected in 083422e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5529728371
|
|
Nice! Tested and works as expected 👍 |
There was a problem hiding this comment.
I've just tested it in http://gutenberg.run, and it works as mentioned. 👍
The code looks good to me, although I'd prefer someone else to also take a look. 🙂 EDIT: Michal already reviewed, approved, and merged the PR. 😄
PS: I guess it is explained somewhere in the file what "root blocks" are, as we're already using that term in other functions. They are the root block of a block tree containing directives, right?
It's a temporary measure to process the directives, but it's not even the correct one because we are processing the blocks multiple times and also processing them as part of a parent block where the search for the |
|
Cherry-picked to |
…dd/defer-script-loading-strategy * 'trunk' of https://github.com/WordPress/gutenberg: Update Changelog for 16.2.0 Adding support for defined IDs in `TextControl` component (#52028) Bump plugin version to 16.2.0 Revert "Bump plugin version to 16.2.0" Bump plugin version to 16.2.0 Add maxLength to LinkControl search items (#52523) [RNMobile] Update Editor block inserter button styles and default text input placeholder/selection styles (#52269) Site Editor: Reset device preview type when exiting the editing mode (#52566) Trim footnote anchors from excerpts (#52518) Add back old Navigation and File blocks JavaScript implementation when Gutenberg is not installed (#52553) Block Editor: Ensure synced patterns are accounted for in 'getAllowedBlocks' (#52546) Fix md5 class messed up with new block key (#52557) Fix entity cache misses for single posts due to string as recordKey (#52338) Make "My patterns" permanently visible (#52531) Hide site hub when resizing frame upwards to avoid overlap (#52180) Fix "Manage all patterns" link appearance (#52532) Update navigation menu title size & weight in detail panels (#52477) Site Editor Patterns: Ensure sidebar does not shrink when long pattern titles are used (#52547) Site Editor: Restore quick inserter 'Browse all' button (#52529) Patterns: update the title of Pattern block in the block inspector card (#52010)
What?
Fix a mismatch between the class added to some blocks and the styles added to the page.
Fixes #52195.
Why?
Because the styles engine is using an md5 of the block array, and adding keys to the array (like
$block['is_inner_block]) changes the md5.How?
Instead of adding a new key to
$block, I used the same md5 technique to keep an array of root blocks.Testing Instructions
Check that the md5-generated class works again:
Check that the Interactivity API server-side rendering still works fine:
hiddenattribute and the "show" class should not be there anymore