magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

[Issue] Fix issues with Customer Data when form contains element with name `method`

Open m2-assistant[bot] opened this issue 1 year ago • 0 comments
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.

image

Related Pull Requests

Fixed Issues (if relevant)

Please create one.

Manual testing scenarios (*)

  1. Open any form (e.g. Customer Registration form),
  2. Open Browser console and replace name="" of any element (e.g. "Remember me") to name="method".
  3. Set breakpoint at customer-data.min.js line after $(document).on('submit', function(event) {.
  4. 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.

image

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)

m2-assistant[bot] avatar Feb 29 '24 13:02 m2-assistant[bot]