The below error is thrown when adding/editing a composite.
Notice: Undefined index: key in Drupal\webform_composite\Form\WebformCompositeForm->validateForm() (line 129 of /var/www/supportcenter/web/modules/contrib/webform_composite/src/Form/WebformCompositeForm.php) #0
It looks like the relevant line does not check that key exists however its expected that its an input. I have to look into which elements and why this does not exist.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | undefined_index_key-2937085-2.patch | 682 bytes | sergiu stici |
Comments
Comment #2
sergiu stici commentedI fixed the issue, here is the patch.
Comment #3
sergiu stici commentedComment #4
jrockowitz commentedI just ran into this issue and the attached patch works as expected.
Comment #5
jungleShould we change the next line to
if ($key !== NULL && isset($keys[$key])?Comment #6
jungleBTW, it's possible to use the null coalescing operator
??See https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op
Comment #7
leeomaraI also just ran into this issue and the attached patch works as expected.
Comment #9
richgerdesThanks for the patch and review!
Since the null coalescing operator was added in 7.0, and php 5.6 was EOL over a years ago, I think its safe to use it. I've committed a version of the patch using the `??`.
This has been committed and released in 1.0-beta3.