When an webform Entity reference field is added to node/entity with 'Unlimited' (or Limited > 1) allowed number of value, webform submissions for all except first webform reference are saved without 'Submitted to' (entity_id and entity_type) values.
This is because of following code in QueryStringWebformSourceEntity() getSourceEntity() method that 'Detect and return a source entity from current context':
On line 156:
if ($source_entity->$webform_field_name->target_id != $webform->id()) {
return NULL;
}
This code gets only target_id of first referenced webform, and in case of multiple referenced webforms, if current webform is e.g. second referenced than this code fails and returns null.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3004000-6.patch | 16.92 KB | jrockowitz |
| #2 | multivalue_webform_reference-3004000-1.patch | 1.11 KB | agolubic |
Comments
Comment #2
agolubic commentedComment #7
jrockowitz commentedThe attached patch adds support for webform fields with multiple values and also includes some refactoring of the related PHPUnit test.
Comment #9
jrockowitz commented@agolubic I committed the updated patch. Please download the latest dev release to review.
Comment #10
agolubic commented@jrockowitz
Works great, tnx 😊