-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: CatalogIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedbug report
Description
Preconditions
- Magento 2.1.7
Steps to reproduce
- Create product attribute with input type media image, and attribute code "side_image" for example
- Create a new product, add a few images, and select the role of one of the images to be the "side_image"
- In our template we want to show the side image (using the block
\Magento\Catalog\Block\Product\View
). Therefore we're adding the following code:
<?php /** @var $block \Magento\Catalog\Block\Product\View */ ?>
<?php
$product = $block->getProduct();
$image = $block->getImage(
$product,
'product_page_image_medium',
['type' => 'side_image']
);
?>
<img src="<?php echo $image->getImageUrl() ?>" />
Expected result
- Product side image shows up
Actual result
- Product base image shows up
A stack exchange question related to this bug can be found here: https://magento.stackexchange.com/questions/102498/extending-the-complextype-named-imagetype-with-a-custom-image-type
Essentially, without having to specify the third parameter, one would expect to create new image types by adding them into the view.xml, like this:
$image = $block->getImage(
$product,
'my_custom_image_id_with_custom_product_image_type'
);
.. however, that's not possible given XSD validation, and hence devs are trying to overwrite the core XSD to simply add their own image types.
The problem here, however, is that the third parameter gets discarded along the way, and that definitely seems like a bug to me.
On top of that, the fact that it's not possible to add image types definitely seems like a design flaw, and maybe the XSD shouldn't be this strict.
schmengler, jantzenw, koenner01, hostep, bodiski and 2 more
Metadata
Metadata
Assignees
Labels
Component: CatalogIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedbug report