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

26825 add all image roles for first product entity #27170

Conversation

sergiy-v
Copy link
Contributor

@sergiy-v sergiy-v commented Mar 5, 2020

Description

Added improvements to GalleryManagement 'create' method to set all image roles for first product entity.

Fixed Issues (if relevant)

#26825

Manual testing scenarios

See #26825 issue description for details.

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 5, 2020

Hi @sergiy-v. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Mar 5, 2020
@rogyar rogyar self-assigned this Mar 5, 2020
@@ -61,6 +61,10 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry)
$existingMediaGalleryEntries = $product->getMediaGalleryEntries();
$existingEntryIds = [];
if ($existingMediaGalleryEntries == null) {
// set all media types if not specified
if ($entry->getTypes() == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, use the strict types comparison (===).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I uses loose comparison here in order to handle few cases for $entry->getTypes(): NULL, [] in the same way like on line 63.
Please clarify in case the extra changes needed here, thanks.


<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCheckImageRolesSelectedActionGroup">
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you, please, split this action group into two separate action groups? Like the following example:

  • AdminOpenProductImagesSectionActionGroup
  • AssertAdminProductImageRolesSelectedActionGroup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I splitted the logic, thank you for suggestions.

@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: MFTF test coverage bugfix Award: bug fix and removed bugfix labels Mar 5, 2020
@sergiy-v sergiy-v force-pushed the 26825-gallery-management-create-method-improvements branch from 6e6a0be to 960732a Compare March 5, 2020 12:55
@sergiy-v sergiy-v requested a review from rogyar March 5, 2020 17:02
@magento-engcom-team
Copy link
Contributor

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

@engcom-Echo engcom-Echo self-assigned this Mar 10, 2020
@engcom-Alfa engcom-Alfa self-assigned this Mar 10, 2020
@engcom-Echo engcom-Echo removed their assignment Mar 11, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@slavvka
Copy link
Member

slavvka commented Mar 15, 2020

@magento run Functional Tests EE

@m2-assistant
Copy link

m2-assistant bot commented Mar 18, 2020

Hi @sergiy-v, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: MFTF test coverage Component: Catalog Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants