Closed (fixed)
Project:
Views filters populate
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2011 at 03:59 UTC
Updated:
11 Jan 2012 at 21:20 UTC
I have been successfully using this module when the initial value of the populating field was 1 for a greater than assertion. This module rocks.
Just put in place a less than, giving the initial value a 9999. However, it comes through as just 9 oddly.
I've double checked the query in the DB and the only thing stopping the view from populating items is this 9 value incorrectly coming the populate filter input.
Make any sense why it would force a single digit?
Comments
Comment #1
doublejosh commentedTried forcing it with a form_alter which changes what's displayed in the filter, but doesn't fix the query.
Comment #2
doublejosh commentedConfirmed that the query always gets only a single digit via pre_execute. Even when exposed and a new value (like 777) is entered, it comes through as 7 in the query.
Comment #3
doublejosh commentedHmmm...
Confirmed that the correct value IS being passed from the exposed populate filter into the real fields via
dsm($view->filter);as well as all the "exposed" view attributes ie.$view->exposed_inputat both the pre_execute and pre_render hook level.It's in
$view->build_infowhere the value has changed to single digit. Assuming this is a good indicator of where the problem is, but not where to go next.Comment #3.0
doublejosh commentedtypos
Comment #4
doublejosh commentedThe query build must truncate this value. However, everything seems fine all the way through views_filters_populate_handler_filter.inc
I can get the value through the view by forcing it into the query (just for testing, because this is gross) with a hook_views_query_alter().
Comment #5
doublejosh commentedimprove title
Comment #6
hanoiiNice catch and thanks for the report.
I think I might have fixed it, it's tricky because different filters has different forms of value objects.
Try git if your are impatient, will soon release a new version with this and another fix.
Comment #7
hanoiiComment #8
doublejosh commentedAwesome.
Glad my thoroughness made it solvable :)
I'll just leave my hack in place until you do the new release. Let me know if you do actually need a test.
Thanks.
Comment #9
hanoiinew release is out there.
test is very much welcome!
Comment #10.0
(not verified) commentedtypo