formie icon indicating copy to clipboard operation
formie copied to clipboard

Issue with Stripe and resetClasses

Open Megafry opened this issue 1 year ago • 1 comments

Describe the bug

The Stripe payment doesn't work if resetClasses is enabled. The script is not able to resolve this.form.getClasses("errorMessage")

payment-provider.js

Uncaught SyntaxError: Failed to execute 'querySelector' on 'Element': '.' is not a valid selector.
 removeError() {
   s(this.$field, this.errorClass);
   const e = this.$field.querySelector(`.${this.errorMessageClass}`);
   e && e.remove()
}

Steps to reproduce

  1. Import this form - formie-testForm.json
  2. Set the resetClasses to true
  3. Try to submit the Stripe payment form.
  4. The console shows errors

Form settings

  • Multi-page form: No
  • Submission Method: Ajax
  • Client-side Validation: Yes
  • Custom Form Templates: Yes

Craft CMS version

5.4.4

Plugin version

3.0.8

Multi-site?

no

Additional context

No response

Megafry avatar Oct 14 '24 09:10 Megafry

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.8".

engram-design avatar Oct 14 '24 21:10 engram-design

Fixed in 3.0.9

engram-design avatar Nov 12 '24 21:11 engram-design