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

Fix Media & Text block crash #1646

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Fix Media & Text block crash #1646

merged 1 commit into from
Dec 6, 2019

Conversation

geriux
Copy link
Member

@geriux geriux commented Dec 4, 2019

Fixes #1650

Gutenberg PR -> WordPress/gutenberg#18907

To test:

  • Open the Gutenberg Web editor:
  • Create a new post with this code:
<!-- wp:media-text {"mediaId":29,"mediaType":"image","imageFill":true,"focalPoint":{"x":0.52,"y":0.12}} -->
<div class="wp-block-media-text alignwide is-stacked-on-mobile is-image-fill"><figure class="wp-block-media-text__media" style="background-image:url(https://geriuxx-atomic-site-1.blog/wp-content/uploads/2019/12/img_0004-1.jpg);background-position:52% 12%"><img src="https://geriuxx-atomic-site-1.blog/wp-content/uploads/2019/12/img_0004-1.jpg" alt="" class="wp-image-29"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph {"placeholder":"Content…","fontSize":"large"} -->
<p class="has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:media-text -->
  • Save
  • Open the newly created post from the Main Apps with metro running.
  • Expect the Media & Text block to be visible without any crashes.

I'm sharing the snippet to test because there's a bug in the web editor that makes the block invalid when the setting Crop image to fill entire column is turned on, due to rounding issues. It has been fixed in master already WordPress/gutenberg#18765 but it is not on production yet.

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@geriux geriux added [Type] Bug Something isn't working Blocks labels Dec 4, 2019
@geriux geriux added bugfix and removed [Type] Bug Something isn't working labels Dec 4, 2019
@geriux geriux marked this pull request as ready for review December 4, 2019 13:46
@mkevins mkevins self-requested a review December 5, 2019 03:01
Copy link
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue as described. I tested with the steps described here: #1650 (comment). Nice work @geriux 🎉 LGTM after resolving conflicts.

@pinarol pinarol added this to the 1.19 milestone Dec 6, 2019
@pinarol pinarol merged commit 407a4bc into develop Dec 6, 2019
@pinarol pinarol deleted the fix/media-text-imagefill branch December 6, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media & Text - Crash due to missing imageFillStyles functionality
3 participants