magento2
magento2 copied to clipboard
[Issue] Fix issues with Customer Data when form contains element with name `method`
trafficstars
This issue is automatically created based on existing pull request: magento/magento2#38449: 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.jsline 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)