Hi,
I'm creating some customized views for a Webform with multiple fields. I'd like to display the results in a Grid, and within that grid, I'd like to ignore fields that were not entered (empty).
I've setup the No Results Behaviour to "Hide if Empty" the field that may or may not be answered on the form, however, the label for the field is still shown in my view, even when no response was given.
I've also checked the Fields settings, and the checkbox for "Hide Empty Fields" is true.
Is there something I'm missing?
Any help is appreciated! For now, I've set up my No Results Behaviour to display "N/A", but it would be great if the field could just be ignored when no response is given.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | webform-hide-if-empty-not-working-in-submission-views-2649508-3.patch | 1.08 KB | alex.skrypnyk |
Comments
Comment #2
kyleheney commentedComment #3
alex.skrypnykThere is indeed an issue with a code that is assessing whether 'empty' option is in use. The code in attached patch checks whether any of 'empty' options where used and rewrites output of the webform submission value.
Comment #4
alex.skrypnykComment #5
liam morlandWhat is the
> 0for?Comment #6
liam morlandComment #7
alex.skrypnyk>What is the > 0 for?
strlen()returns integer so we are explicitly comparing it to an integer to show what is actually going on.Also changing this to 'Bug report' since this is existing functionality that does not work.
This patch is working on several websites for the past 2 years. Need someone to review and RTBC please.
Comment #8
liam morlandstrlen($this->options['empty']) > 0can be just(string) $this->options['empty']. That will return TRUE for any non-empty string.Comment #9
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.