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.
When trying to add a Sub-conditional group operator to a webform conditional, i was receiving Undefined index: "andor".
I found that these errors were all reported on ternary operators, added additional validation that the array structure existed.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2847359-12-andor-conditional.patch | 861 bytes | joelpittet |
| |||
#10 | 2847359-patch.diff | 2.09 KB | noisegatemedia |
#9 | 2847359-patch.diff | 2.09 KB | noisegatemedia |
Comments
Comment #2
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedPlease ignore this patch, incorrect file uploaded.
Comment #3
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #4
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #5
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #8
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #9
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #10
noisegatemedia CreditAttribution: noisegatemedia as a volunteer commentedComment #11
Liam MorlandPossibly related: #2842513: Undefined index: operator in _webform_conditional_expand().
Comment #12
joelpittetI'm using dev release and also running into these notices. The
source_type
issue has been resolved in another issue, so just theandor
index missing.Too test I just add a bunch of conditionals and looked at the logs:
Rerolling this patch.
Comment #13
Liam MorlandWhat are the steps to reproduce the problem? I tried following the description but could not get the error to appear.
Comment #14
joelpittet@Liam Morland Not exactly sure how to describe the problem... I guess it needs sub conditions already to trigger the bug and I added a few more and it $conditional['andor'] wasn't there when it was looking for it.
Comment #15
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedIts a little bit hard to read.
Can we replace it with something like
$current_op = isset($conditional['andor']) && $parent_rid < 0
? $conditional['andor']
: $parent_values[$parent_rid]['operator'];
Comment #16
Liam MorlandMaybe a better solution is to ensure
andor
is always set.Figuring out the steps to reproduce the problem would likely make it easier to track down the best solution.