I'm trying to create a page where the users can save its searches, but I realized that the data for the exposed filters is not saved on the DB. The 'filters' field in the views_savedsearches table gets an empty array (a:0:{}).

I found a couple of possibles bugs like a missing parameter in the views_savedsearches_save function and the _views_savedsearches_params_to_filters function is not getting the filters selected.

I will really appreciate any help.
Thanks

Comments

apv’s picture

same issue..anyone has the answer ,please help

Thanks

droberge’s picture

I ran into the same issue. As it turns out, it seems like an issue inside the java script included with the saved search module. My best guess is that Views was updated and this module was not. The line I patched was:

//formData.push({ name: 'views_filters_form', value: $('form#views-filters').formSerialize() });
var theForm = $('.view-filters form')[0];
formData.push({ name: 'views_filters_form', value: $(theForm).formSerialize() });

Patching this line allowed the searches to be saved correctly.

Hope this helps

maryedith’s picture

I had the same issue. Implemented the patch suggested above, and drupal saved my exposed filter. However, I got this message:
warning: implode() [function.implode]: Invalid arguments passed in /var/www/vhosts/maryedithconsulting.com/subdomains/test1/httpdocs/acquia/sites/all/modules/views_savedsearches/views_savedsearches.module on line 183.

droberge, can you provide a patch to correct this?
Many thanks!

pydubreucq’s picture

Hi,
I have the same issue but your patch don't work for me :(
I have modified the views_savedsearches.js file at line 45 and 61
I put that :

 45     //formData.push({ name: 'views_filters_form', value: $('form#views-filters').formSerialize() });
 46 var theForm = $('.view-filters form')[0];
 47 formData.push({ name: 'views_filters_form', value: $(theForm).formSerialize() });

AND

 63     //formData.push({ name: 'views_filters_form', value: $('form#views-filters').formSerialize() });
 64 var theForm = $('.view-filters form')[0];
 65 formData.push({ name: 'views_filters_form', value: $(theForm).formSerialize() });

Do you know why it's don't work for me ?
And I would like to know if this module is supported or not ?

Thanks by advance ;)

Best Regards
Pyd

pydubreucq’s picture

Hi all,
This patch works on another server, I don't know why ???
But I have the same error than @maryedith :(
I saw this problem just apear when I save the search.
After I can use my saved Search without error...
Excuse me I'm French and I don't speak english very well :(
Thanks by advance ;)
Bye
Pyd

redpuma’s picture

Same issue here:
I just tried the second patch from Pyd and it works.

redpuma’s picture

StatusFileSize
new1.1 KB

Just created a patch file based on the above #2 and #4 patch code.

pydubreucq’s picture

Hi,
Thanks for this patch, but It doesn't work for me :(
I have this error message :
patch -p0 < views_savedsearches.js_.464156-4.patch
patching file views_savedsearches.js
Hunk #1 FAILED at 42.
Hunk #2 FAILED at 59.
2 out of 2 hunks FAILED -- saving rejects to file views_savedsearches.js.rej
I don't know why :(
Thanks by advance ;)
CiaO ++

pydubreucq’s picture

Excuse-me I'm tired...
My js file was already modified ;)
It's work fine with the original file ;)
CiaO ++

pydubreucq’s picture

Hi,
I have the same problem than @maryedith
warning: implode() [function.implode]: Invalid arguments passed in /var/www/drupal/sites/all/modules/views_savedsearches/views_savedsearches.module on line 183.
:(
Anybody have this problem ?
Thanks by advance ;)

redpuma’s picture

Hi Pyd,
what servers are they?

I'm running this on a Debian Etch server, but will deploy onto a Centos (Redhat) server later so I'm hoping I don't get this problem. Can you say what the server's differences are?

Steve

pydubreucq’s picture

Hi,
This is my configuration :
Ubuntu 9.04
Apache 2.2.11-2ubuntu2.3
PHP 5.2.6.dfsg.1-3ubuntu4.2
Mysql 5.1.30really5.0.75-0ubuntu10.2 (I know it's not a mysql problem, but with this you have all my information)
I infer that you do not have the same problem ?
Bye

pydubreucq’s picture

For information I have tested with and whitout php safe_mod
And It's not a problem with that...

pydubreucq’s picture

Hi,
In my search I use :
- Textarea for word key
- List based on Taxonomy
- List based on cck field
Do you use the same ?
Thanks by advance ;)

pydubreucq’s picture

Hi all :D
I found how to solve my problem :)
This problem (php warning error with implode function) was because my view use ajax
I edit my view to modify ajax use and It's work fine ;)
Thanks for all ;)
Bye

pydubreucq’s picture

Arf,
I'm happy too fast...
This problem is not solved... :(
Sniff... :(
I don't know why this problem appears...

pydubreucq’s picture

Hi,
To solve the problem with implode you can modify at line 183 on views_savedsearches.module file
//$form['#redirect'][1] = implode('&', $query);
$form['#redirect'][1] = request_uri();
I don't found the response alone, it's emerya a member of Drupal French forum :)
Thanks

wonder95’s picture

The patch by @redpuma in #7 and the fix in #17 by @pydubreucq made it work for me.

johnlee80’s picture

I'm struggling with this module. I've tried all the suggestions on this page but nothing shows.

If I configured everything correctly, should the 'save search' link simply appear underneath or above the exposed search form?

aron novak’s picture

I confirm #18 , those two changes simply make the stuff work.
Sidenote: I wanted to prepare one patch to cover all these changes, but usually such patches needs to be done against -dev. I checked out the HEAD from the CVS and the saving form did not appear.

quicksketch’s picture

Anyone interested in maintaining this module (and fixing this problem), please see #652972: Views Saved Searches needs a new maintainer.

aron novak’s picture

Status: Active » Fixed

Try 6.x-1.0-beta2, it should be fixed now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

om252345’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-beta3

Hello friends
First I want to thank who created views & views saved searches.
I want to give a bug report. Views do not save exposed filters when views have exposed form in block
to yes. So the result to saved searches is the path to view page
Please solve.

itzramona’s picture

I have tried it in the block mode and I agree that it does not work. Are you implying above that if you use it in page mode it works?

marianista’s picture

Hello everyone!!! Im spanish, excuse me for my english...

I´m using Saved Searches 6.x-1.0-beta3

In my search (view) I use :
- Textarea for word key
- List based on Taxonomy with hierarchical select
- List based on cck field
- Textarea for cck field

The problem:

* warning: Invalid argument supplied for foreach() in ...mypath.../sites/all/modules/hierarchical_select/hierarchical_select.module on line 864.
* warning: Invalid argument supplied for foreach() in ...mypath.../sites/all/modules/hierarchical_select/hierarchical_select.module on line 547.

The filters are saved in the data base without poblems, and the error is only with the hierarchical select...

And other problem is that i cant use the block "My views saved search"... i don´t know why... i activate the block but it doesn run!!!

Please HELP!!!

marianista’s picture

ok, the solution?...use the favorite module, includin an input text to describe the serarch...

thanks!!

elwood’s picture

following

gianfrasoft’s picture

following

gianfrasoft’s picture

Take a look at this:

http://drupal.org/node/956726