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 setting emails to exclude empty components all values from grid component are excluded, even if they are not empty.
Comment | File | Size | Author |
---|---|---|---|
#3 | webform-grid_empty_values-2577649-3.patch | 1.21 KB | DanChadwick |
#2 | webform-grid-excluded-from-emails-2577649-2.patch | 631 bytes | emek |
Comments
Comment #2
emek CreditAttribution: emek at Lund University commentedThe error was because the check for empty values are checking $data[0] when grid values are stored in an associative array.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedThanks 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.