Hi,
I’m trying to use view_savedsearches modules in order to notify users on new custom content posts.
The first issue was the impossibility to store saved search filters in the database. Hopefully, this was already fixed in another post by modifying the « views_savedsearches.js » file:
Function ahahDeleteBeforeSubmit
Line 37 : formData.push({ name: 'views_filters_form', value: $('form#views-filters')[0].formSerialize() });
Function ahahSaveBeforeSubmit
Line 53: formData.push({ name: 'views_filters_form', value: $('.view-'+ view_name+ ' .view-filters form')[0].formSerialize() });
With this only fix, the modules work very well BUT only for simple exposed content views filter (eg : search filter is price < 2000 € ).
In fact, I created a view of cars sales announce content type on which I want like to add search filter for the price and distance with integer operator is between min and max value.
In this case, search criteria of the exposed form in block store my saved search in database : (a:2:{s:23:"field_price";a:1:{s:3:"min";s:2:"10";s:3:"max";s:5:"30000";}s:16:"field_distance";a:2:{s:3:"min";s:0:"";s:3:"max";s:0:"";}}) but when I choose a saved search, it displays all the announces.
Apparently the problem is in the URL generation.
When in do a research the result’s page URL is :
…/recherche_auto?field_kilometrage_value[min]=&field_kilometrage_value[max]=1000&field_prix_value[min]=&field_prix_value[max]=
And when I load a saved search, result’s page URL is :
…/recherche_auto?field_kilometrage_value[]=&field_kilometrage_value[]=1000&field_prix_value[]=&field_prix_value[]= (min an max don't appear)
So the only problem is, I think, that the views_savedsearches_save_search_form function in views_savedsearches.module doesn’t generate correctly the result URL.
I’m totally newbie in Drupal so can anyone help me?
Comments
Comment #1
sLL4yeR commentedI noticed that the same problem happens when i'm searching with Hierarchical Select Taxonomy term.
No idea?
Comment #2
sLL4yeR commentedI seem that the is a problem in the '_views_savedsearches_filters_to_params' function.
I'm trying to work on it
Comment #3
sLL4yeR commentedOk, here is my version of the _views_savedsearches_filters_to_params function :
It may need some impovement but it works with my needs (Integer interval filter and Hierarchical Select Taxonomy)
Comment #4
remydenton commentedI ran into this same bug as well and ended up creating a very similar patch to fix it. I'm also using beta3, though from a quick glance it doesn't look like beta4 has addressed this either.