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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

noisegatemedia created an issue. See original summary.

noisegatemedia’s picture

Please ignore this patch, incorrect file uploaded.

noisegatemedia’s picture

noisegatemedia’s picture

noisegatemedia’s picture

The last submitted patch, 2: 2847038-patch.diff, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: Patch-2847359.diff, failed testing.

noisegatemedia’s picture

FileSize
2.09 KB
noisegatemedia’s picture

FileSize
2.09 KB
noisegatemedia’s picture

Liam Morland’s picture

joelpittet’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
861 bytes

I'm using dev release and also running into these notices. The source_type issue has been resolved in another issue, so just the andor index missing.

Too test I just add a bunch of conditionals and looked at the logs:

Notice: Undefined index: andor in webform_conditional_element_add() (line 767 of webform/includes/webform.conditionals.inc).

Rerolling this patch.

Liam Morland’s picture

What are the steps to reproduce the problem? I tried following the description but could not get the error to appear.

joelpittet’s picture

@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.

andrey.troeglazov’s picture

Its 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'];

Liam Morland’s picture

Maybe 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.