Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gallery block: turn on auto-migration of v1 Gallery blocks to v2 form…
…at when edited (#36191) * Remove update gallery modal * Add check for gallery v2 compat (block sites with use_BalanceTags option enabled and aren't on WP 5.9 or higher) to editor init so it is available when block deprecation pipeline runs * Remove references to gallery experimental flag * Add missing transformation updates * Update fixture to be compat with v2 of gallery block * Fix unit tests * Fix issue with link destination not being set when block migrated * Use `window.wp` global instead of store for gallery flag To resolve a race with the deprecations and asynchronous store updates for the gallery flag, we can use a property on the global wp object instead. * Simplify deprecations, etc. by always using using v1 methods if use_balanceTags is on regardless of content format * Move assignment of gallery global flag to native Editor. This moves the setting of the global flag higher in the view hierarchy, since the provider's constructor is still too late (parsing code invokes the deprecations before even the provider is instantiated). * Default to `true` for gallery flag when not yet cached This makes sure the global value for the flag is established when the editor is initialized, since some users may not have the value cached locally yet. This is important to avoid incorrectly branching in the parsing step, resulting in an incompatible block format. * Only update gallery flag if fetch result is explicitly boolean * Update the wording of the mobile warning * Add filter to prevent use_balanceTags being enabled on WP < 5.9 * Switch to using settings_error for use_balanceTags notice * Add a CLI error message Co-authored-by: Glen Davies <glen.davies@a8c.com> Co-authored-by: Matthew Kevins <mmkevins@yahoo.com>
- Loading branch information