When Jquery Update in on the install, deleting does not work. (minor priority?).

Comments

eme’s picture

Status: Active » Fixed

Seems to work with jquery update 2.x and latest release of views saved search.

For those who have the same issue, update jquery update !

eme’s picture

Status: Fixed » Active

Strange. It works on one of my install, but not another one, and if I desactivate the module jquery update, it works fine again...

eme’s picture

Works with old 1.4 version, not 2.x one.

LGLC’s picture

Is there any way around this without downgrading to jQuery Update 1.4? Unfortunately doing so isn't an option on one of my sites. Thanks.

maxichka’s picture

Issue tags: +jQuery

Here is how I solved this issue.

Open file views_savedsearches.js

Go to Line 28

Delete Code

if ($('div#view-'+ view_name +'-savedsearches-container div.views-savedsearches-list-ahah form:first :checkbox[@checked]').length == 0) {

Replace it with

if ($('div#view-'+ view_name +'-savedsearches-container div.views-savedsearches-list-ahah form:first :checkbox').attr('checked') == false) {
LGLC’s picture

This worked brilliantly for me. Thanks so much, maxichka!

jwjoshuawalker’s picture

Hate to post on such an old topic, but I was experiencing the same thing. The code in #5 worked only if the top checkbox was selected. If I had multiple saved searches and checked any of them other than the first, it would give them "You must select at least one saved search to be deleted!" message.

I changed that area to this:

    // Validate checkboxes: at least one must be checked.
	var checked = false;
	$('div#view-'+ view_name +'-savedsearches-container div.views-savedsearches-list-ahah form :checkbox').each(function(){ 
	  if($(this).attr('checked')) {
	    checked = true;
	  }
	});
	
	if(checked == false) {
      alert("You must select at least one saved search to be deleted!");
      return false;
    }
Anonymous’s picture

Status: Active » Needs review

Thanks
Patch #7 worked

Changed status to 'needs review' for more feedback from the community

nbchip’s picture

Patch #7 works
but then i get error from module:
Fatal error: Call to a member function get_url() on a non-object in C:\xampp\htdocs\x\sites\all\modules\views_savedsearches-7.x-1.0-beta1\views_savedsearches\views_savedsearches.module on line 790

jwjoshuawalker’s picture

@nbchip

That error is unrelated to changes in #7. This was also from the D6 version of the module, I haven't used D7 version - not sure if things are different (not sure if you need this).

Also I just realized after finding a checked box and setting checked = true; there should be a break; to get things movin'!

marty.true’s picture

I got the same error as @nbchip and this is the D7 version...
Has there been a fix for this? It seems the D7 version is not working as long as ajax is enabled.

pounard’s picture

For the PHP fatal error (get_url()) please apply those two patches:
#781978: Problem with @checked
#1826102: Fatal error: Call to undefined function notifications_user_get_subscriptions()

Hope it helps.