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 #10687 - Product image roles disappearing #15606

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

Scarraban
Copy link

@Scarraban Scarraban commented May 30, 2018

To fix #10687 - adds the 'types' key to the images array to provide existing image roles, which are reset after clearMediaAttribute() is called.

Description

This PR is to fix the issue outlined in #10687 - image roles being removed when saving by the ProductRepository.

Fixed Issues (if relevant)

  1. Product image roles randomly disappear #10687: Product image roles randomly disappear

Manual testing scenarios

  1. Initially save a product using the ProductRepostory, setting an image in the gallery with roles.
  2. Save the product again, without setting the media gallery at all. Roles should persist after second save.

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)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 30, 2018

CLA assistant check
All committers have signed the CLA.

To fix magento#10687 - adds the 'types' key to the $images array to provide existing image roles (if not set), which are re-attributed after clearMediaAttribute() is called
@sidolov sidolov self-requested a review August 6, 2018 14:12
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-2672 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@Scarraban thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @Scarraban. Thank you for your contribution.
We will aim to release these changes as part of 2.2.7.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@michel334
Copy link

Hi @Scarraban. Any chance you have the fix for Magento version 2.2.3 ?

Magento 2.2.3 has no file
vendor\magento\module-catalog\Model\ProductRepository\MediaGalleryProcessor.php
but only
vendor\magento\module-catalog\Model\ProductRepository.php

@Scarraban
Copy link
Author

Scarraban commented Oct 29, 2018

Hi @michel334 ,

Check my replication steps comment on the issue #10687 - this was a patch fix that references the ProductRepository.php file before I made the pull request.

@michel334
Copy link

michel334 commented Oct 31, 2018

Thanks @Scarraban for the patch, it fixed our issue!

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.

7 participants