When rebuild query module lost clause which came from arguments
Eugef - November 21, 2007 - 11:49
| Project: | Views save filter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Eugef |
| Status: | closed |
Jump to:
Description
In function views_savefilter_views_query_alter you empty where clause by doing this
$query->where = array();
But $query can contain not only filter clauses but clauses from argumnets of the view, so this arguments have NOT to be deleted.
I find out, that this arguments clauses are already formated and don't contain "%s", so i modify this code by mine:
/* [e+]leave only whose clause, which is not filters but arguments to view*/
/* they dont have %s in text*/
$new_query_where = array();
for ($qw=0; $qw<sizeof($query->where);$qw++) {
if (strpos($query->where[$qw], '%s') === false) {
$new_query_where[] = $query->where[$qw];
}
}
$query->where = $new_query_where;
/*[e+]*/I test this code on default "taxonomy/term" view and it work perfect!
I think you can include this pathc to next version of module.

#1
This should be fixed now. Thanks for the report!