webform_civicrm icon indicating copy to clipboard operation
webform_civicrm copied to clipboard

Fixes E-notice Undefined index

Open stesi561 opened this issue 4 years ago • 3 comments

Overview

Fixes an error notice that was clogging up logs.

Before

Drupal watchdog logs filled up with annoying error notices.

After

Drupal watchdog logs fill up with other annoying error notices. But at least this one no longer causes pain.

Technical Details

Extracted part of the logic from the IF into a variable and test for existence of array keys before referencing them.

stesi561 avatar Nov 17 '20 04:11 stesi561

Hi Luke - have you checked what this looks like in the D8 branch?

KarinG avatar Nov 18 '20 15:11 KarinG

It doesn't quite apply cleanly due to change between array syntax. But appart from that is the same in D8. Which potentially this should be using array() instead of [].

Do you want me to reformat this to use array() instead of [], and also create something for D8 as well?

stesi561 avatar Nov 24 '20 03:11 stesi561

Hi Luke - can you please first submit a PR for D8 -> we have some automated testing now! Once merged we'll backport it to D7.

KarinG avatar Nov 29 '20 00:11 KarinG