Skip to content

[BUGFIX] Unset Image Data if store is not the Admin Storeview #15014

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

lewisvoncken
Copy link
Contributor

@lewisvoncken lewisvoncken commented May 5, 2018

This will solve the following issue:

Description

'When a product gets updated on storeviewlevel the Image Data will be transported to the storeview which should not be possible because Images can only be set on Admin Level'

Fixed Issues (if relevant)

  1. API REST product images, Label in one website and roles in other #14287: API REST product images, Label in one website and roles in other
  2. Insert product images on multiple websites problem #14413: Insert product images on multiple websites problem

Manual testing scenarios

  1. Create a Product with images and assign Image Roles through the API (through the all call)
  2. Check in the catalog_product_entity_varchar table by filtering with following query:
SELECT * FROM `catalog_product_entity_varchar` WHERE `attribute_id` IN(87,88,89,132
/** 87,88,89,132 are the image attributes in a default installation */
  1. Now the values are on Admin Level
  2. Update the Product name on storeviewlevel (for example a translation) through the API (through the storecode default call)
  3. Check in the catalog_product_entity_varchar table by filtering with following query:
SELECT * FROM `catalog_product_entity_varchar` WHERE `attribute_id` IN(87,88,89,132
/** 87,88,89,132 are the image attributes in a default installation */
  1. Now the values are duplicated to the storeview level

Apply changes, remove the product and try again and the result will be that the values aren't duplicated to the storeviewlevel.

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)

This will solve the following issue:

 'When a product gets updated on storeviewlevel the Image Data will be transported to the storeview which should not be possible because Images can only be set on Admin Level'
@VladimirZaets
Copy link
Contributor

Hi @lewisvoncken , we have functional tests that were failed with your changes. That's are

Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreate
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithoutFileExtension
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testUpdateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testDelete
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testAddProductVideo
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreate
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithoutFileExtension
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testUpdateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testDelete
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testAddProductVideo
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreate
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithoutFileExtension
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testUpdateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testDelete
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testAddProductVideo
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreate
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithoutFileExtension
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testCreateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testUpdateWithNotDefaultStoreId
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testDelete
Magento.Catalog.Api.ProductAttributeMediaGalleryManagementInterfaceTest.testAddProductVideo
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery
Magento.Catalog.Api.ProductRepositoryInterfaceTest.testProductWithMediaGallery

Can you look and fix them, please?
If you need some help or guide how to running functional tests locally, please let us know.

/**
* @param $product
*/
protected function filterImageData($product)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change protected to private due to Magento Technical Guidelines

@VladimirZaets
Copy link
Contributor

@lewisvoncken, I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

@VladimirZaets
Copy link
Contributor

Hi @lewisvoncken, are you work on this PR?

@VladimirZaets
Copy link
Contributor

Hi @lewisvoncken, I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

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.

3 participants