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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | show_0_value_fields-1339044-7.patch | 771 bytes | klaasvw |
| #6 | Fix-for-1339044-Empty0-numeric-fields-are-hidden-on-.patch | 1017 bytes | Anonymous (not verified) |
| #4 | views-1339044.patch | 709 bytes | Anonymous (not verified) |
| #2 | views-1339044.patch | 32.66 KB | Anonymous (not verified) |
Comments
Comment #1
dawehnerPlease always provide a real patch, it's somehow easier to review and you can't make any mistakes when you apply the patch.
Comment #2
Anonymous (not verified) commentedHere it is.
Edit: Dont know what happened, this patch must be deleted. Is incorrect.
Comment #3
Anonymous (not verified) commentedComment #4
Anonymous (not verified) commentedThis is the patch to review.
Comment #5
dawehnerI'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.
Comment #6
Anonymous (not verified) commentedOn 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 ?
Comment #7
klaasvw commentedJavier's patch works for me.
Here's a reroll for 7.x-3.x-dev
Comment #8
klaasvw commentedMarking 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.
Comment #9
dawehnerCommitted the patch from here to 7.x-3.x