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

Gallery Block Gap fatal error #40158

Closed
Jastos opened this issue Apr 7, 2022 · 1 comment
Closed

Gallery Block Gap fatal error #40158

Jastos opened this issue Apr 7, 2022 · 1 comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended

Comments

@Jastos
Copy link

Jastos commented Apr 7, 2022

Description

When adding a value to "Block Spacing" in a gallery block, I get:

PHP Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /wp-content/plugins/gutenberg/build/block-library/blocks/gallery.php:51

If I var_dump the value of the $gap variable, I get this value:
array(2) { ["top"]=> string(4) "30px" ["left"]=> string(4) "30px" }

If I clear out the block spacing value, or comment out the preg_match line, things work.

Step-by-step reproduction instructions

  1. Install the gutenberg plugin
  2. Add a gallery block
  3. Add a block spacing value
  4. Get an error

Screenshots, screen recording, code snippet

image

Environment info

  • PHP 8.0.17
  • Gutenberg 12.9.0
  • WP 5.9.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mikachan mikachan added [Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended labels Apr 7, 2022
@glendaviesnz
Copy link
Contributor

Thanks for reporting @Jastos - this was fixed here #39788 - and the fix should be in 13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants