When setting emails to exclude empty components all values from grid component are excluded, even if they are not empty.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emek created an issue. See original summary.

emek’s picture

Status: Active » Needs review
FileSize
631 bytes

The error was because the check for empty values are checking $data[0] when grid values are stored in an associative array.

DanChadwick’s picture

Status: Needs review » Fixed
FileSize
1.21 KB

Thanks for the report and patch. You were in the right place but didn't get the code quite right.

Grids store their values indexed by question key, which may be associative or even numeric (if the question keys are numeric). To determine if a grid is empty, we need to iterate through all the values looking for a non-empty string.

Committed to 7.x-4.x and 8.x.

I looked quickly for other places where this could be a problem. If/when conditionals work with grid components, there are a number of places that will similarly have to be updated.

  • DanChadwick committed 537ce9d on 8.x-4.x
    Issue #2577649 by DanChadwick and emek: Fixed values from grid component...

  • DanChadwick committed 913258a on
    Issue #2577649 by DanChadwick and emek: Fixed values from grid component...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.