Conversation
qasumitbagthariya
left a comment
There was a problem hiding this comment.
QA Update ❌
When two Mailchimp forms (including a widget) are present on the same page, the entered data does not persist after submission.
Steps to Reproduce:
- Add two Mailchimp forms (one as a form and one as a widget) on the same page.
- Fill out the form fields in both forms.
- Submit one of the forms.
- Observe that the data in the other form is lost.
Screen.Recording.2025-03-24.at.4.02.23.PM.mov
Testing Environment
Details
- WordPress: 6.7.2
- Theme: Storefront 4.6.1
- Theme: Twenty Twenty-Four 1.3
- PHP: 8.0.30
- Web Server: Nginx 1.20.2
- Browser: Chrome
- OS: macOS 15.2
- Branch: fix/100
QA Update ✅I have verified this PR in the I tested the following on this branch:
Screen.Recording.2025-03-25.at.7.26.54.PM.movTesting Environment Details
Steps to Test- As mentioned in the PR description.
|
|
Note: We need to make a minor change by adding a class (similar to what we added in the |
Regression / Smoke Test Report ✅Tested with the Testing Environment Details
Next Step- Ready to Merge 🚀 |
Description of the Change
This PR fixes the form data reset issue by ensuring that form data persists when validation fails.
It only addresses the form reset issue for JavaScript-based submissions, as HTML form submission will be removed in version 1.7.0 (already removed in #126)
Note
This PR resolves the issue by updating the regex to correctly determine whether the response is an error or a success based on the class in the returned markup. Ideally, this should be handled by updating the code to return a proper JSON response, but for now, the fix is applied to the existing code, with potential improvements planned for the future.
Closes #100
How to test the Change
Changelog Entry
Credits
Props @MaxwellGarceau @iamdharmesh
Checklist: