8000 Move bunch of javascript variables from global scope to local scope in magnifier.js file by hostep · Pull Request #39321 · magento/magento2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move bunch of javascript variables from global scope to local scope in magnifier.js file #39321

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

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

Conversation

hostep
Copy link
Contributor
@hostep hostep commented Nov 3, 2024

Description (*)

Due to a mistake in a 9 year old commit where a , was incorrectly changed to a ;, a bunch of JS variables became globally scoped and no longer scoped inside the local Magnify function.

This PR fixes that.

To better review the changes in this PR, please ignore whitespace changes: https://github.com/magento/magento2/pull/39321/files?w=1

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Magnifier.js syntax error #36200

Manual testing scenarios (*)

  1. Have a Magento shop with a product with some images
  2. Visit that product in the frontend
  3. Open your browsers javascript console
  4. Execute console.log(magnifierOptions);
  5. Test the magnifier functionality on the product images

Expected:
4. Shouldn't work, magnifierOptions should not be available in global scope
5. Magnifier functionality should keep working the way it worked before

Questions or comments

I won't be updating/writing automated tests, because I have no idea how to do that in scope of this change. If that's required, please do it yourself :)

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)

Copy link
m2-assistant bot commented Nov 3, 2024

Hi @hostep. 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-community-project m2-community-project bot added Priority: P3 May be fixed according to the position in the backlog. Progress: pending review labels Nov 3, 2024
@hostep
Copy link
Contributor Author
hostep commented Nov 3, 2024

@magento run all tests

@engcom-Bravo
Copy link
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Contributor

Hi @hostep,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Have a Magento shop with a product with some images
  • Visit that product in the frontend
  • Open your browsers javascript console
  • Execute console.log(magnifierOptions);
  • Test the magnifier functionality on the product images

Before: ✖️ 

Screenshot 2025-05-19 at 11 44 03 am

After: ✔️

Magnifier functionality was working the way it worked before

Screenshot 2025-05-19 at 2 17 35 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 May 19, 2025
@engcom-Dash engcom-Dash self-assigned this May 20, 2025
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

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

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

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

1 similar comment
@engcom-Dash
Copy link
Contributor

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

@engcom-Dash
Copy link
Contributor

The consistent test failures for Functional B2B are known Issues and JIRA is raised for them. They neither part of PR nor failing because of the PR changes

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/b46b15ae87488bc3c0f84948c8b56622/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/5aa103f9d3b984984ee36b11458f139e/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007
StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest : ACQE-7971
OrderWithMultipleConfigurableProductsAdditionalStockTest : ACQE-8060

The consistent test failures for Functional CE are known Issues and JIRA is raised for the same. Other failure is inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/d375b3df82c77025750a97737648fa4e/Functional/allure-report-ce/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/f1478ab4366aacaf0c16e8f43dd0f77f/Functional/allure-report-ce/index.html#categories/1ebe0280aba7ee40465acd3f13b81139/bcd23d88e4dd5b1e/

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007
StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest: ACQE-7683

The consistent test failure for Functional EE is known Issues and JIRA is raised for the same. Other failure is inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/4349849f41e69051370550d658cc60be/Functional/allure-report-ee/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39321/1b602745cfa954e118d370cc5b06204d/Functional/allure-report-ee/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007

Hence moving this PR in Merge In Progress.

@engcom-Dash engcom-Dash moved this from Extended testing (optional) to Merge in Progress in Community Dashboard May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P3 May be fixed according to the position in the backlog. Project: Community Picked PRs upvoted by the community Risk: low
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

Magnifier.js syntax error
5 participants
0