I have a set of nodes with CCK fields of type integer.

When a field contains the value zero it is not displayed. The views options "Hide if empty" and "Count the number 0 as empty" have NOT been selected.

If I enter a text in the "Empty text" field, this text is displayed when my CCK field contains a zero.

So, when the CCK field contains a zero, it behaves as if the field is empty, even though this option to do so has not been selected.

I want to display a - when a field is empty and a 0 when the field contains a zero.

In the issues list I see similar messages, but I think this one is different. Do I overlook something? Is this a bug? Is there a work around?

Comments

sphopkins’s picture

Status: Active » Closed (duplicate)

Duplicate of #546586: 0 not considered valid alternate or empty text and I am having someone look to see if they can fix it.

merlinofchaos’s picture

Status: Closed (duplicate) » Active

It sounds like this is actually different from that one, which is about arguments.

sphopkins’s picture

If that is the case then #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... has been marked as a duplicate and closed when it should not have as this is the issue that was in that issue. I assume that these are all related.

In an analysis of the situation I have been able to get "0 " (zero-space) to display a zero in a text field when it was not displaying before. Integer fields have not been fixed yet.

Goofy2k’s picture

I had a look at #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... and my issue indeed looks similar to that one. So I agree with sphopkins #3 that this issue was considered a duplicate erroneously.

Work-arounds mentioned in #559102 are not OK for me. I definitely want users to recognize empty fields. I do not want the system to show a zero when the field is empty.

sphopkins’s picture

Agreed. My issue started out just like Goofy2k's and was redirected into this issue.

sphopkins’s picture

Status: Active » Closed (duplicate)

I have marked this as a duplicate of #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... and I have summarized the work we have done there.