Active
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 May 2013 at 11:58 UTC
Updated:
12 Mar 2015 at 13:57 UTC
Jump to comment: Most recent
Hi,
i use the proximity search with views and it works fine.
showing the distance field and hiding it, if it is empty also works fine.
when i choose round and precission 2, then the "empty" fields with 0.00 will not be hidden.
does anyone has an idea how to fix this?
Comments
Comment #1
Golem07 commentedI'd be very interested in a solution to this as well.
Comment #2
dmegatool commentedYeah this is a bug. I'm not a coder so I don't have a fix or patch for it.
But here's how I managed to hide my field if it's empty.
<?php print round($row->field_geofield_distance, 1); ?>Adjust the variable so it use your proximity field. The 1 is the precision so it will output ex: 3.1So that's about it, it should work. Note that this leaved me with an empty line caused by
<br></br>in the DOM. I couldn't remove it so I hacked around with css like so :<div class="emptyDistance"></div>.emptyDistance {display: block; margin-bottom: -1rem;}in my css and it was all good. Of course adjust the margin to your liking if your doing this.
So all in all, we're just rounding using PHP instead of the default proximity field. It still should be fixed as this is a bug and users are expecting it to work.
Comment #3
dmegatool commentedSeems like it's a Views issue ?
Discussed here. There's even a patch (I didn't test it).