Hi,
Problem/Motivation
I create a webform using Term select component. This component is linked to a vocabulary "Subject".
When i tried to submit my webform, i got the following notice :
Notice: Undefined index #target_type in /var/www/html/myproject/modules/contrib/webform/src/Plugin/WebformElement /WebformEntityReferenceTrait.php on line 106
Proposed resolution
The error came from the fact that the property '#target_type' doesn't exist in $element.
It can be fixed by getting the entity type directly on $entity with getEntityTypeId() method.
See the proposed path attached.
Comments
Comment #2
tsymi commentedComment #3
tsymi commentedThe proposed patch is attached.
Comment #4
jrockowitz commented@Tsymi Patch makes sense to me. Thanks.
Next time, please just set the ticket's status to 'Needs review' which will trigger the automated tests.
I will commit the patch as soon as all the tests pass.
Comment #6
jrockowitz commented