0 not considered valid alternate or empty text
dww - August 11, 2009 - 23:25
| Project: | Views |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | dww |
| Status: | needs review |
Description
I noticed this while testing #510910: When multiple fields share a column in table view only the last field displays. If you define a "Global: Custom text" field and give it the value "0", that won't show up in your view, apparently due to some render() related special case for rewriting and custom text handling. It's a separate bug from #510910 so I'm opening a new issue for it... Very obscure, so I'm calling this minor for now. ;)

#1
Based on further investigation, we just aren't considering '0' to be valid alternate text nor empty text. Attached patch fixes (and applies cleanly to both DRUPAL-6--3 and HEAD).
#2
From IRC:
merlinofchaos: WFM.Tested and committed to HEAD and DRUPAL-6--3. Guess this is still minor, even though it's not as minor as I originally thought. ;)
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Backporting this fix to Views 2 did not solve the issue for me.
render()ing the values means that$this->last_renderhas a string '0' instead of an int 0 -- need to test for this:- if ($this->last_render !== 0 || !empty($this->options['empty_zero'])) {+ if (($this->last_render !== 0 && $this->last_render !== '0') || !empty($this->options['empty_zero'])) {
Patch for 2.x-dev attached. I'm not sure whether this change is necessary for 3.x-dev as well.
btw, #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... looks to be a dup of this issue, where folks are still experiencing the issue, (as I was.)
#5
I have been posting in the other thread #559102: Views thinks that a 0 value is empty even when the box 'Count the number 0 as empty' is unchecked... and I am glad that someone has some ideas here.
I tested this patch on my machine and I do not thing that it worked. Note that I am using it on views 2.7.
I will post any results here
#6
I'm having the same issue- applied the patch and it didn't fix the problem. I'll keep looking into it and post what I find.
#7
Need to verify this but when you apply the patch to 6.2.8 I get a whitescreen....That andViews 2.8 still does not display '0' at all when this patch is applied (properly as well... for some reason I did not apply it properly hence the whitescreen).