esmero / webform_strawberryfield

Provides Webform integrations to feed a field of Strawberries. Mr. Wizard of WebOz
GNU Lesser General Public License v3.0
2 stars 6 forks source link

Provide notification message for disassociated Form Modes #81

Open alliomeria opened 3 years ago

alliomeria commented 3 years ago

What?

If no webform is associated for a Form Mode (in settings), show users a notification message instead of an error.

DiegoPino commented 3 years ago

Good. This affects both Inline webform and the normal webform widget. The exact error is happening here (my bad) where I assume that at least the default form will be available.

https://github.com/esmero/webform_strawberryfield/blob/1.0.0-RC1/src/Plugin/Field/FieldWidget/StrawberryFieldWebFormInlineWidget.php#L204-L208

So check needs to be way before. If nothing is setup (like no settings) and also if the webform no longer exists, better tell the user and Send some Log for the admin and do not try to be a smart-dev.