Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform-fix_target_type_using_term_select_component-2862495-3.patch | 613 bytes | Tsymi |
|
Comments
Comment #2
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedComment #3
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedThe proposed patch is attached.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House 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 CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented