magento2
magento2 copied to clipboard
Fix issues with Customer Data when form contains element with name `method`
Description (*)
The path to verify <form method="">
value in customer-data.js
(Magento_Customer
) is glitchy and when there's an element with name="method"
in the submitted form, the event.target.method
refers to element, not attribute.
Related Pull Requests
Fixed Issues (if relevant)
Please create one.
Manual testing scenarios (*)
- Open any form (e.g. Customer Registration form),
- Open Browser console and replace
name=""
of any element (e.g. "Remember me") toname="method"
. - Set breakpoint at
customer-data.min.js
line after$(document).on('submit', function(event) {
. - Expect that
if ()
section (1 line below) uses<form method="">
- not just created element.
Questions or comments
We noticed the issue while troubleshooting Paradoxlabs Firstdata extension issues.
CC @rhoerr
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)
Resolved issues:
- [x] resolves magento/magento2#38484: Fix issues with Customer Data when form contains element with name
method
Hi @lbajsarowicz. Thank you for your contribution! Here are some useful tips on 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
:exclamation: 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:
-
Database Compare
-
Functional Tests CE
-
Functional Tests EE
-
Functional Tests B2B
-
Integration Tests
-
Magento Health Index
-
Sample Data Tests CE
-
Sample Data Tests EE
-
Sample Data Tests B2B
-
Static Tests
-
Unit Tests
-
WebAPI Tests
-
Semantic Version Checker
You can find more information about the builds here :information_source: 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.
@magento run all tests
@ihor-sviziev Would you mind performing Code Review?
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, WebAPI Tests
@magento run Sample Data Tests B2B, Sample Data Tests CE, Sample Data Tests EE
Failed to run the builds. Please try to re-run them later.
@magento run all tests
Here we go again with tests, as I added extra file responsible for the issue.
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE
@magento run Functional Tests B2B, Functional Tests EE, Sample Data Tests CE, Sample Data Tests B2B, Sample Data Tests EE
Hello @lbajsarowicz It is not required to run the Sample Data tests. It doesn't work now ))
Oh, thanks @andrewbess, I wasn't aware
The functional test failures look like flaky:
- Functional Tests EE
- https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38449/874e87d7857268893f2d57c5bb4bdc74/Functional/allure-report-ee/index.html
- https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38449/346231f14634050a4357fbc39ce5f780/Functional/allure-report-ee/index.html
- Functional Tests B2B
- https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38449/677d7063c8cb647019915e0bcaf30db8/Functional/allure-report-b2b/index.html
Oh, thanks @andrewbess, I wasn't aware
Happy return on board @lbajsarowicz
@magento run Functional Tests B2B, Functional Tests EE
@magento create issue
:heavy_check_mark: QA Passed
Preconditions:
- Install fresh Magento
2.4-develop
Manual testing scenario: We have followed steps from comment
Before: :heavy_multiplication_x:
After: :heavy_check_mark:
Builds are failed. Hence, moving this PR to Extended Testing.
@magento run all tests
@magento run Functional Tests EE,Functional Tests CE
@magento run Functional Tests B2B
Functional Tests CE,Functional Tests B2B failure are different on last two run on same commit.
Functional Tests CE
Run1
Run2
Functional Tests B2B
Run1
Run2
Hence Moving it to Merge in progress
.
@magento run Functional Tests CE,Functional Tests B2B