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

Comments

kyleheney created an issue. See original summary.

kyleheney’s picture

Issue summary: View changes
alex.skrypnyk’s picture

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

alex.skrypnyk’s picture

Status: Active » Needs review
liam morland’s picture

What is the > 0 for?

liam morland’s picture

Category: Support request » Feature request
alex.skrypnyk’s picture

Category: Feature request » Bug report

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

liam morland’s picture

Version: 7.x-4.12 » 7.x-4.x-dev

strlen($this->options['empty']) > 0 can be just (string) $this->options['empty']. That will return TRUE for any non-empty string.

liam morland’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.