Closed (works as designed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2013 at 16:43 UTC
Updated:
12 Mar 2013 at 18:16 UTC
The contextual filter will return no results when the filter value is an actual float, i.e. 200.202. With integer values it works fine.
Steps to reproduce:
I hope this is trivial to fix :)
Comments
Comment #1
a.ross commentedFWIW, after reproducing on a clean install, I've done
git checkout 7.x-3.5all the way back to 7.x-3.0 and the bug is present in all versions.Comment #2
a.ross commentedAlso, with a normal float field it works as expected. Only the List (Float) field type is affected.
Comment #3
a.ross commentedUgh, the funny thing is that the query looks mighty fine:
Comment #4
a.ross commenteddouble post
Comment #4.0
a.ross commentedUpdated issue summary.
Comment #5
a.ross commentedIt turns out that the List (float) field type stores its values as float in the database. And at least in the case of MySQL, problems like this are apparently expected behavior: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
A way to work around this problem would be to use a decimal field. But that may not work in every use-case, since a decimal is basically an integer and, therefore, doesn't allow for very high values. Also, it appears that a List (decimal) field doesn't really exist at all...