Skip to content

#25042 Remove logo dimension parameters from layout files #25789

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

Conversation

mfickers
Copy link
Contributor

Description (*)

This PR fixes a problem where a new logo is uploaded in the backend, without specifying width and height parameters. Magento then used the logo_img_width and logo_img_height block arguments set in the layout file for the Logo block as fallback, possibly distorting the new logo. This is confusing behavior for the user, as the logo should be displayed with its native dimensions if no width and height parameters are explicitly set.

Notice that it is still possible to configure the logo dimension via layout files, using logo_width and logo_height instead of logo_img_width and logo_img_height as block arguments. With this changes, the logo_img_width and logo_img_height block arguments are no longer used by the block.

Fixed Issues (if relevant)

  1. Store logo inherits height and width from luma logo, if no height and width is provided #25042: Store logo inherits height and width from luma logo, if no height and width is provided

Manual testing scenarios (*)

  1. Upload a new logo in the backend (Content > Design > Configuration > Global > Edit > Header > Upload Logo), don't set the height and width fields
  2. Clear cache
  3. Got to storefront homepage
  4. Logo dimension should be native image dimension, not Luma logo dimension

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@mfickers mfickers requested a review from melnikovi as a code owner November 28, 2019 12:22
@m2-assistant
Copy link

m2-assistant bot commented Nov 28, 2019

Hi @mfickers. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@dmytro-ch dmytro-ch left a comment

Choose a reason for hiding this comment

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

Hello @mfickers, thank you for your contribution. Due to Magento Definition of Done the changes should be covered by tests. Could you please cover your fix by automated tests?
At least by unit test in \Magento\Theme\Test\Unit\Block\Html\Header\LogoTest.
Thank you!

@mfickers
Copy link
Contributor Author

I've added unit tests for both image dimension getters of the header logo block.

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-6371 has been created to process this Pull Request

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Dec 3, 2019

Hi @mfickers, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.5 milestone Dec 3, 2019
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.

5 participants