Skip to content

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

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #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)

Metadata

Metadata

Assignees

Labels

Area: FrameworkComponent: FrontendIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions