Skip to content

View.xml is inheriting image sizes from parent (so an optional field is replaced by the value of parent) #12250

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

Closed
quisse opened this issue Nov 14, 2017 · 5 comments
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@quisse
Copy link

quisse commented Nov 14, 2017

I want to resize my images to a width of 250px and keep the aspect ratio (so I'm not adding a height tag). Instead of resizing the image to the full height of the image, Magento takes the height for that image from the parent theme's view.xml. So "If your theme does not contain a view.xml configuration file, it will be inherited from the parent theme. If you add the <theme_dir>/etc/view.xml file in your theme, it overrides the parent’s file." is a lie?

Preconditions

  1. Magento 2.1.9
  2. PHP 7.0.25

Steps to reproduce

  1. Copy view.xml from a parent theme and add it to new theme
  2. Remove <height> tag from image
  3. Resize images
            <image id="product_page_image_small" type="thumbnail">
                <width>250</width>
                <aspect_ratio>true</aspect_ratio>
                <frame>false</frame>
            </image>

Expected result

  1. An image with 250px width which kept the aspect ratio without adding

Actual result

  1. An image with 250px width and 90px height (as defined in the parent view.xml)
  2. image
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 14, 2017
@magento-engcom-team
Copy link
Contributor

@quisse, thank you for your report.
We've created internal ticket(s) MAGETWO-84055 to track progress on the issue.

@magento-engcom-team
Copy link
Contributor

Hi @quisse. Thank you for your report.
The issue has been fixed in #14537 by @quisse in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.7 release.

@sidolov
Copy link
Contributor

sidolov commented Aug 8, 2018

Hi @quisse. Thank you for your report.
The issue has been fixed in #17439 by @quisse in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.16 release.

@sidolov
Copy link
Contributor

sidolov commented Aug 26, 2018

Hi @quisse. Thank you for your report.
The issue has been fixed in #17725 by @nmalevanec in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@sidolov sidolov added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Aug 26, 2018
@gwharton
Copy link
Contributor

I realise this is old and long go closed, but anyone know if there is there a way of preventing the inheritance of entire images from the parent view.xml files. It would appear if I remove unrequired image types from my view.xml, they just get added from the parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants