Hi all,

I have downloaded the last release for drupal 7 and I'm having some issues. I want to hide a field if it is empty. If I rewrite the output using NO RESULT BEHAVIOUR with a message like "Filed is empty", the view shows up the field filled with the text "Field is empty". Ok, here everything is fine.

Then I decide to change the behaviour and hide the field when it is empty. Then I remove the text "Field is empty" in the NO RESULT BEHAVIOUR box and click in the checkbox "Hide if empty". After this, the view is still showing the field, however, in this case the field doesn't show any result.

Any help about this issue?

Thanks
Javier

Comments

Mołot’s picture

Then I remove the text "Field is empty" in the NO RESULT BEHAVIOUR
My best guess is that you have 0-lenght string or white characters now instead of NULL. Try exporting your views and checking it in php array.

javier.drupal.2012’s picture

Hi @Molot,

thanks for your quick answer. I have exported the view and here it is:

/* Field: User: Nombre empresa */
$handler->display->display_options['fields']['field_nombre_empresa']['id'] = 'field_nombre_empresa';
$handler->display->display_options['fields']['field_nombre_empresa']['table'] = 'field_data_field_nombre_empresa';
$handler->display->display_options['fields']['field_nombre_empresa']['field'] = 'field_nombre_empresa';
$handler->display->display_options['fields']['field_nombre_empresa']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['field_nombre_empresa']['hide_alter_empty'] = FALSE;

There is no any handler like

$handler->display->display_options['fields']['field_nombre_empresa']['empty'] = '';

Thus I think my view configuration may be right.

What do you think?

Thanks heaps
Javier

Mołot’s picture

Looks good. To bad, it would be easier if the error was easily wisible.

['hide_alter_empty'] = FALSE; // You do not alter this field in any way? No rewrites and stuff?

javier.drupal.2012’s picture

Maybe there is a module I have installed which is involved in the issue. I don't know. Do you know any module what have some problems with views?
Thanks

Mołot’s picture

Many ;) Prety much anything that integrates with them caused problems at least couple times in development history (if lucky, only in dev version).
Can you make a fresh Drupal+views install, export needed data and wiev there, and see if it's still happening? If so, it's about time to fill bug report. If not, turn on module after module until you can recreate it and you're done.

marameodesign’s picture

I just would like to report the same issue. I will investigate and let you know if I find the problem.

marameodesign’s picture

I have disabled and created the view again - all working fine - perhaps a temporary glitch?

Mołot’s picture

"The more powerful engine, the easier it chokes." Worls for cars, works for software as well.
If original author can't see it happening, it must be a random error. I was not able to reproduce, so I think it should be postponed until someone will find a way to reproduce it on the purpose.