Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
11 Aug 2009 at 23:25 UTC
Updated:
23 Mar 2011 at 19:45 UTC
Jump to comment: Most recent file
Comments
Comment #1
dwwBased 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).
Comment #2
dwwFrom IRC:
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. ;)
Comment #4
jeffschulerBackporting 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: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.)
Comment #5
sphopkins commentedI 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
Comment #6
dashton commentedI'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.
Comment #7
sphopkins commentedNeed 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).Comment #8
merlinofchaos commentedPatch in #4 looks correct to me, and it does fix the issues I can reproduce. If there are issues that it does not fix, they might be separate, but I don't know how to recreate them to test. I have committed it to all branches.
Comment #9
aren cambre commentedSubscribe (in case this issue gets more attention later).
Comment #11
NaX commentedI have just run into this same issue and the patch did not fix the problem I had.
I have a table view with CCK fields. One of the CCK text fields is sometimes empty. So I set the Empty text option, but it was not displaying the empty text.
After some investigation I found that because I also had the Link this field to its node option set the empty field was rendering empty links.
EG:
<a href="node/115"></a>When I set the Hide if empty then only does the empty text get displayed.
Is this by design? The way I understand stood things, the un-rendered field is what should be checked for being empty and the hide if empty options remove the field from the display (Label and all, if possible) if empty.
If I understand things correctly maybe the render_text function should also check for empty text.
Hope that all makes sense.
Comment #12
merlinofchaos commentedEmpty links seems like a different issue than not accepting 0 as empty. Call me crazy.
Comment #13
timbraeckman commentedI also have an issue like this. I have matches and when there is no score there is nothing stored in the database. But for some reason views show 0 instead of empty. I want it to show 0 when there is a 0 in the database and nothing when there is nothing in the database. Can anyone tell me how to fix this please?
Comment #14
esmerel commentedThis has been closed twice; it's a different issue if there's still a problem.