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 spacing changes the size of images and ignores the column setting #39778

Closed
carolinan opened this issue Mar 26, 2022 · 2 comments · Fixed by #39788
Closed

gallery block spacing changes the size of images and ignores the column setting #39778

carolinan opened this issue Mar 26, 2022 · 2 comments · Fixed by #39788
Assignees
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable

Comments

@carolinan
Copy link
Contributor

carolinan commented Mar 26, 2022

Description

With Gutenberg trunk, if you add a value to the block spacing setting in the gallery block, the size of the images change.
Instead of fitting the images inside the columns set in the gallery, the image size is drastically changed and the images are displayed one by one, vertically. The effect is the same no matter the number of columns that are set, or the image size.

Step-by-step reproduction instructions

Test with a theme with support for blockGap.

  1. Open the block editor
  2. Add a gallery block with images
  3. try to use the block spacing setting

Screenshots, screen recording, code snippet

gallery.mp4

Environment info

WordPress 5.9.2
Gutenberg trunk ( at 41325b9)
Chrome, Windows 10, multiple block themes

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

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Gallery Affects the Gallery Block - used to display groups of images labels Mar 26, 2022
@carolinan carolinan changed the title gallery block spacing changes the size of images gallery block spacing changes the size of images and ignores the column setting Mar 26, 2022
@carolinan carolinan added the [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable label Mar 26, 2022
@carolinan
Copy link
Contributor Author

@glendaviesnz
As I continued testing this, I found a PHP warning in the editor. I am using PHP 7.4.1.
Warning: preg_match() expects parameter 2 to be string, array given in gutenberg\build\block-library\blocks\gallery.php on line 51

Line 51

(-I did a dump of $gap and it is an array containing both the top and left spacing values.)

@ramonjd
Copy link
Member

ramonjd commented Mar 27, 2022

Looks like ce74a0d borked things. I'm looking into getting a fix in today. Thanks for flagging @carolinan and @glendaviesnz

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 [Type] Feedback Issues that relate purely to feedback on a feature that isn't necessarily actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants