Closed (fixed)
Project:
Views Hacks
Version:
6.x-1.x-dev
Component:
Views Filters Selective
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2011 at 15:29 UTC
Updated:
19 Jan 2011 at 15:20 UTC
After installing the dev version of the views_hacks module I ran into errors with the Views Filters Selective component. I traced it to the database prefix not being added.
I made an edit to the views_filters_selective.module which seemed to fix the problem.
Before (line 183)
if ($filter->view->base_table == 'node' && in_array('vid', array_keys($schema['fields']))) {
$result = db_query("SELECT DISTINCT(t.$field_name) FROM {$table_name} t INNER JOIN {node} n ON t.vid = n.vid WHERE t.{$filter->view->base_field} IN (%s)", implode(',', $oids));
}
else {
$result = db_query("SELECT DISTINCT($field_name) FROM {$table_name} WHERE {$filter->view->base_field} IN (%s)", implode(',', $oids));
}
After
if ($filter->view->base_table == 'node' && in_array('vid', array_keys($schema['fields']))) {
$result = db_query("SELECT DISTINCT(t.%s) FROM {%s} t INNER JOIN {node} n ON t.vid = n.vid WHERE t.{$filter->view->base_field} IN (%s)", $field_name, $table_name, implode(',', $oids));
}
else {
$result = db_query("SELECT DISTINCT(%s) FROM {%s} WHERE {$filter->view->base_field} IN (%s)", $field_name, $table_name, implode(',', $oids));
}
Comments
Comment #1
infojunkieGreat catch, thanks! I fixed it a little differently than here, so please try it 12 hours from now and let me know if it works for you.
Comment #2
easp commentedTested latest dev version and appears to be working fine.
Thanks! . . . and great module. I use it a lot.