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 image size feature #23342

Merged
merged 1 commit into from
Jun 22, 2020
Merged

Fix image size feature #23342

merged 1 commit into from
Jun 22, 2020

Conversation

jeyip
Copy link
Contributor

@jeyip jeyip commented Jun 21, 2020

Fixes this issue posted in wp-calyspo Automattic/wp-calypso#43197

Description

The image sizing feature was entirely non-functional.

Screen Shot on 2020-06-11 at 15:37:58

It looks like the culprit was a PR that refactored the Image Block a month ago. To verify, I also tested the changes before the specific commit was merged (image sizing worked)

In the updateImage method, the newUrl was inadvertently omitted from attribute updates. As a result, the image size control wasn't displaying changes in the user interface.

How has this been tested?

  • Set up a local instance of WordPress and Gutenberg by following instructions here
  • Navigate to the Gutenberg editor my sites -> posts -> Add New Post
  • Create an image block
  • Upload or select an image from the media library to display
  • Click on the settings cog
  • Select the image
  • Change image size

Screenshots

fix-image-size-feature

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

When the updateImage function was refactored in a previous commit (1063573), the new image url was inadvertantly omitted from the update. As a result, the image size control wasn't displaying changes in the user interface.

This change passes the correct url to image attribute updates.
@jeyip jeyip changed the title Set image attributes with newly generated url Fix image size feature Jun 21, 2020
@simison simison added the [Type] Bug An existing feature does not function as intended label Jun 22, 2020
@simison simison requested a review from youknowriad June 22, 2020 08:51
@simison simison added the [Block] Image Affects the Image Block label Jun 22, 2020
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

👍

@youknowriad youknowriad merged commit 4d874d7 into WordPress:master Jun 22, 2020
@youknowriad
Copy link
Contributor

Thanks for the fix.

@github-actions
Copy link

Congratulations on your first merged pull request, @jeyip! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 22, 2020
@github-actions github-actions bot added this to the Gutenberg 8.4 milestone Jun 22, 2020
@jeyip jeyip deleted the fix/image-size-feature branch June 22, 2020 15:37
This was referenced Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants