The queryable_variables.module file has a small, but critical, bug in it. I use this module to save variables mostly associated with nothing. By that, I mean I usually have queryable_variables_set('field_name',$field_value); and that's all. After playing around a bit with taxonomy terms, I understood that the queryable_variables table was... empty! At first I thought that I had left somewhere around in my modules a DELETE query for the table, but I couldn't think of any reason why I would have done something like this. Then I decided to see the code of the queryable_variables.module file.
At line 30, where function queryable_variables_taxonomy() exists, we can see that there is a $array as an argument. A few lines below, we delete all variables in queryable_variables database table where vid equals $array->vid and/or tid equals $array->tid. And that's exactly where the false is. $array is actually and array and not an object. As a result, $array->vid and $array->tid are null and when the delete function runs, it deletes all values that have vid and/or tid equal to null/zero. This of course means every variable not associated with a [aid...zid] field. By altering the code to $array['vid'] and $array['tid'] everything works as expected.
function queryable_variables_taxonomy($op, $type, $array = NULL)
{
if ($op == 'delete' && $type == 'vocabulary')
{
queryable_variables_del_all('vid', $array['vid']);
}
if ($op == 'delete' && $type == 'term')
{
queryable_variables_del_all('tid', $array['tid']);
}
}| Comment | File | Size | Author |
|---|---|---|---|
| queryable_variables.patch | 688 bytes | vensires |
Comments
Comment #1
crystaldawn commentedhmm that would be a big "doh!" lol. I'll patch this up asap. Cant have stuff like that laying around.
Comment #2
crystaldawn commentedThis issue is fixed in 6.x.3.12.
Comment #3
vensires