Skip to content

Conversation

@nmalevanec
Copy link
Contributor

Original Pull Request

#13438

Description

Image builder is used few times with different parameters in \Magento\Catalog\Block\Product\AbstractProduct::getImage.
In case when on first call $attributes was set to not empty array, on second call - $attributes is empty array - builder re-used attributes from first call, as result - we will get unexpected result - attributes will be re-used from 1st call.

$this->imageBuilder->setProduct($product)
    ->setImageId($imageId)
    ->setAttributes($attributes)
    ->create();

As builder designed to be used multiple times - let's remove check that attributes array is not empty.

Fixed Issues (if relevant)

N/A

Manual testing scenarios

See description

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 on Travis CI are green)

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Feb 19, 2018

Hi @nmalevanec. Thank you so much for your effort of forward porting this change into 2.3.x, but currently we already have pull request with the same changes into 2.3-develop branch that was created earlier: #13439.
Unfortunately I should close your PR as duplicate.

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.

2 participants