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

magento/magento2#39481: Completely removing a gallery-image from be k… #39680

Open
wants to merge 14 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

pavel77718
Copy link

Description (*)

  • fixed inheritance of the role of a deleted image after adding a new one

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear #39481

Manual testing scenarios (*)

  1. add a simple product
  2. add an image in the default scope and select "base" type/role
  3. make sure the type/role has been inherited by the store-scopes
  4. remove or change types/roles in a store_view scope (i.e. remove the "base" type/role)
  5. completely remove the gallery image (from scopes and from default)
  6. re-add a new image in the default scope and flag the type/role "base"

Expected result

After adding a new image, the roles will be set by default.

Questions or comments

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

…e roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear

- fixed issue with "old" roles/types after re-adding images
Copy link

m2-assistant bot commented Feb 28, 2025

Hi @pavel77718. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-github-services m2-github-services added Partner: Perspective partners-contribution Pull Request is created by Magento Partner labels Feb 28, 2025
@pavel77718
Copy link
Author

@magento run all tests

…e roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear

- changed copyright
@engcom-Bravo engcom-Bravo added the Priority: P3 May be fixed according to the position in the backlog. label Feb 28, 2025
@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run Functional Tests EE

@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run Database Compare, Functional Tests B2B, Functional EE

@pavel77718
Copy link
Author

@magento run Functional Tests EE

@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run Functional Tests B2B, WebAPI Tests

@pavel77718
Copy link
Author

@magento run all tests

@pavel77718
Copy link
Author

@magento run Functional Tests CE

2 similar comments
@pavel77718
Copy link
Author

@magento run Functional Tests CE

@pavel77718
Copy link
Author

@magento run Functional Tests CE

@Priyakshic Priyakshic added the Project: Community Picked PRs upvoted by the community label Mar 13, 2025
@Priyakshic Priyakshic moved this to Pending Review in Community Dashboard Mar 13, 2025
@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel engcom-Hotel moved this from Pending Review to Review in Progress in Community Dashboard Mar 27, 2025
Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @pavel77718,

Thanks for the contribution!

The code changes seems good to us, but please check my review comments below and add some automated test to verify the PR changes.

Thanks

@@ -1,6 +1,6 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2015 Adobe
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be 2013, as the file has been created in this year only

Copy link
Author

Choose a reason for hiding this comment

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

I changed it.

@@ -355,6 +355,11 @@ define([
imageData.isRemoved = true;
$imageContainer.addClass('removed').hide().find('.is-removed').val(1);

$.each(this.options.types, $.proxy(function (index, type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggesting to add an comment for this newly added code block, so that in future developer can relate with it.

Copy link
Author

Choose a reason for hiding this comment

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

I added a comment for the new code block.

@engcom-Hotel engcom-Hotel moved this from Review in Progress to Changes Requested in Community Dashboard Mar 27, 2025
@pavel77718
Copy link
Author

@magento run all tests

@engcom-Hotel engcom-Hotel moved this from Changes Requested to Review in Progress in Community Dashboard Apr 1, 2025
@engcom-Hotel engcom-Hotel moved this from Review in Progress to Ready for Testing in Community Dashboard Apr 1, 2025
@engcom-Bravo engcom-Bravo moved this from Ready for Testing to Testing in Progress in Community Dashboard Apr 1, 2025
@engcom-Bravo
Copy link
Contributor

Hi @pavel77718,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • add a simple product
  • add an image in the default scope and select "base" type/role
  • make sure the type/role has been inherited by the store-scopes
  • remove or change types/roles in a store_view scope (i.e. remove the "base" type/role)
  • completely remove the gallery image (from scopes and from default)
  • re-add a new image in the default scope and flag the type/role "base"

Before: ✖️ 

Simple-Products-Inventory-Catalog-Magento-Admin-04-01-2025_01_22_PM

After: ✔️

COnfigureeee-Products-Inventory-Catalog-Magento-Admin-04-01-2025_01_57_PM

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

@engcom-Bravo engcom-Bravo moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Apr 1, 2025
@engcom-Charlie engcom-Charlie self-assigned this Apr 2, 2025
@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B

@engcom-Charlie
Copy link
Contributor

Two of the tests in Functional B2B failures are not consistent. Neither failing because of the PR changes nor part of PR. They seem to be flaky. One of the consistent test is a known issue and has a JIRA for the same. Hence moving this PR to Merge in Progress.

Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39680/eac7c210ad926437da04b1f956347988/Functional/allure-report-b2b/index.html#categories/2fc037f47773dd7551f2e766bbf34efa/7b345b9f066fe118/

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39680/6e93581c6813f37e768cd8d38e65c401/Functional/allure-report-b2b/index.html#categories/2fc037f47773dd7551f2e766bbf34efa/f2def3f54579f7ae/

image

Known Issue:
ACQE-7751 : CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest

@engcom-Charlie engcom-Charlie moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Perspective partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: ready for testing Project: Community Picked PRs upvoted by the community
Projects
Status: Merge in Progress
6 participants