Problem/Motivation
The following error is thrown when a webform element is deleted:
Error: Call to undefined method Drupal\webform_ui\Form\WebformUiElementDeleteForm::getEntity() in entity_mesh_form_alter() (line 116 of /var/www/html/docroot/modules/contrib/entity_mesh/entity_mesh.module).

| Comment | File | Size | Author |
|---|---|---|---|
| webform-field-delete-error.png | 56.8 KB | frouco |
Issue fork entity_mesh-3526552
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3526552-php-error-on
changes, plain diff MR !34
Comments
Comment #2
frouco commentedComment #3
frouco commentedComment #4
frouco commentedComment #6
lpeidro commentedComment #7
lpeidro commentedThe issue is that the getEntity() method is not implemented in all form classes — only in those that extend from ContentEntityForm.
To avoid this error, we should first check whether the form object is an instance of ContentEntityDeleteForm, or a compatible class, before calling the method.
It is ready for QA.
Comment #8
lpeidro commentedComment #10
frouco commentedAfter applying the patch, deleting a webform element works correctly.
Comment #13
lpeidro commented