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

Update mobile block editor settings to use Gallery block v2 for WordPress 5.9+ #50569

Closed
wants to merge 1 commit into from

Conversation

derekblank
Copy link
Member

What?

Attempts to fix an issue where users on WordPress 5.9+ receive the wrong version of the Gallery block.

Related issues:

Why?

When a self-hosted site is using WordPress 5.9+ and the Gutenberg plugin is not installed, the Gallery block defaults to v1. This is due to the prop galleryWithImageBlocks being unknown.

How?

In the mobile block editor settings, the list and quote blocks are instructed to use v2 versions. This PR introduces a similar instruction for the Gallery block for sites using WP 5.9+. (This technique was also used when the Gallery block v1 was temporarily deprecated, which has since been reverted.)
Caveat: I noted that as this code is in lib/experiments, it may not be available to users without the Gutenberg plugin installed, which is the group that would benefit the most from this change. However, perhaps this PR could be a starting point for how we leverage a similar technique to provide either the WP version number or the galleryWithImageBlocks flag itself to users without the plugin installed.

Testing Instructions

  1. Create a self-hosted site with WordPress version 5.9 or above.
  2. Check that the Gutenberg plugin is not installed. If not, uninstall it.
  3. Create a post.
  4. Insert a Gallery block.
  5. Observe that the Gallery block is v2 (content is rendered using inner blocks).
  6. Repeat the above steps for a self-hosted site using WordPress 5.8 or below.
  7. Observe that the Gallery block is using v1 (content is rendered using inner blocks).

@derekblank derekblank added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label May 12, 2023
@derekblank derekblank requested a review from fluiddot May 12, 2023 05:52
@derekblank
Copy link
Member Author

Closing in favor of handling this in the main apps.

@derekblank derekblank closed this May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant