Problem/Motivation
Due to @see Webform 6.x code refactoring to not override constructors for service objects, plugins, and controllers, this stripe_webform module in its current state is unable to add the Stripe Validation handler.
After attempting to added the Stripe validation handler, on the "Email / Handlers" admin page (i.e. /admin/structure/webform/manage/course_event_registration/handlers ) errors are reported.
Example of errors:
Notice: Undefined index: stripe_element in Drupal\stripe_webform\Plugin\WebformHandler\StripeWebformHandler->buildConfigurationForm() (line 106 of /var/www/html/web/modules/contrib/stripe_webform/src/Plugin/WebformHandler/StripeWebformHandler.php)
Notice: Undefined index: amount in Drupal\stripe_webform\Plugin\WebformHandler\StripeWebformHandler->buildConfigurationForm() (line 112 of /var/www/html/web/modules/contrib/stripe_webform/src/Plugin/WebformHandler/StripeWebformHandler.php)
Notice: Undefined index: plan_id in Drupal\stripe_webform\Plugin\WebformHandler\StripeWebformHandler->buildConfigurationForm() (line 126 of /var/www/html/web/modules/contrib/stripe_webform/src/Plugin/WebformHandler/StripeWebformHandler.php)
Eventually these undefined index errors conclude with an error from webform module. An example of such an error: Error: Call to a member function get() on null in Drupal\webform\Plugin\WebformHandlerBase->isExcluded() (line 310 of /var/www/html/web/modules/contrib/webform/src/Plugin/WebformHandlerBase.php)
Additional resources sourced from the above @see Webform 6.x code refactoring link for more context:
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | stripe_webform-webform600compatibility-3190708-0.patch | 3.32 KB | skounis |
Comments
Comment #2
skounis commentedThis patch fixes the compatibility with the v6.0.0 of webforms. In more details
1. Add the theme template for the summary of the handler.
2. Refactors the webform handler so it will not override the constructor.
A patched version of the module for testing is available also on GitHub
- https://github.com/skounis/stripe_webform
Comment #3
skounis commentedComment #4
skounis commentedComment #6
hanoiiFixed, thanks! I'll soon release a new version.
Comment #7
dreambubbler commentedThank you, I've tested the current 8.x-1.x version, with webform 6.0.2 and it works without errors. Your effort into this is appreciated!