If u have a numeric field whose value is 0, it is skipped on:

http://drupalcode.org/project/views.git/blob/refs/heads/7.x-3.x:/theme/t... 555

if (empty($field_output) && !empty($vars['rows'][$num][$column])) {

Fixes with:

if (empty($field_output) && $renders[$num][$field] !== '0' && !empty($vars['rows'][$num][$column])) {

I' m posting here with no patch for somebody with a little time to apply (i dont have views code locally to produce the patch... must clone it... etc....etc) Without time to do it now.

Hope somebody understand and fixes this 1 line bug.

CommentFileSizeAuthor
#7 show_0_value_fields-1339044-7.patch771 bytesklaasvw
#6 Fix-for-1339044-Empty0-numeric-fields-are-hidden-on-.patch1017 bytesAnonymous (not verified)
#4 views-1339044.patch709 bytesAnonymous (not verified)
#2 views-1339044.patch32.66 KBAnonymous (not verified)

Comments

dawehner’s picture

Status: Needs review » Needs work

Please always provide a real patch, it's somehow easier to review and you can't make any mistakes when you apply the patch.

Anonymous’s picture

Status: Needs review » Needs work
StatusFileSize
new32.66 KB

Here it is.

Edit: Dont know what happened, this patch must be deleted. Is incorrect.

Anonymous’s picture

Status: Needs work » Needs review
Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new709 bytes

This is the patch to review.

dawehner’s picture

Title: Patch for problem with numeric field display on tables » Empty(0) numeric fields are hidden on table style.
Status: Needs review » Needs work
+++ b/theme/theme.incundefined
@@ -552,7 +552,7 @@
+        if (empty($field_output) && $renders[$num][$field] !== '0' && !empty($vars['rows'][$num][$column])) {

I'm wondering why you check for two different variables. Wouldn't work $vars['rows'][$num][$column] as well?

There is a option on each field, whether zero is empty or not. I would think this information should be used on tables as well.

Anonymous’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc3
Status: Needs work » Needs review
StatusFileSize
new1017 bytes

On 7.x-3.0-rc3 code, the solution seems to be this new patch. Maybe somebody can port it to latest code 7.x-3.x-dev ?

klaasvw’s picture

Version: 7.x-3.0-rc3 » 7.x-3.x-dev
StatusFileSize
new771 bytes

Javier's patch works for me.

Here's a reroll for 7.x-3.x-dev

klaasvw’s picture

Status: Needs review » Closed (duplicate)

Marking 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 reposting the above patch to the original issue.

dawehner’s picture

Committed the patch from here to 7.x-3.x