Just got this error when trying to uninstall the module in latest D7 dev.

CommentFileSizeAuthor
#6 db_delete-1164308-3.patch303 bytesCory Goodwin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Draven_Caine’s picture

Same for me, Just un-installed the module. and .. Notice: Undefined property: DeleteQuery::$execute in switchtheme_uninstall() (line 15 of /.../.../.../public_html/sites/all/modules/switchtheme/switchtheme.install).

johnlaine’s picture

I also had this error and now I can't change themes in the admin->appearance screen. Well, I can change the theme but it does not change on the site. If I reinstall and enable the switchtheme module I can then change themes. So apparently it is not uninstalling completely, something left behind in the database? This is the switchtheme.install file, the error is referring to the line 14: ->condition('name', 'switchtheme_%', 'LIKE')
I'm a noob, so any help is greatly appreciated.

<?php
// $Id: switchtheme.install,v 1.1 2011/01/07 23:41:22 sun Exp $

/**
 * @file
 * Installation functions for Switchtheme module.
 */

/**
 * Implements hook_uninstall().
 */
function switchtheme_uninstall() {
  db_delete('variable')
    ->condition('name', 'switchtheme_%', 'LIKE')
    ->execute;
}
?>
johnlaine’s picture

Ok, so I figured out that the error was in the last line "->execute;" it is missing the "()" , like this:

<?php
// $Id: switchtheme.install,v 1.1 2011/01/07 23:41:22 sun Exp $

/**
* @file
* Installation functions for Switchtheme module.
*/

/**
* Implements hook_uninstall().
*/
function switchtheme_uninstall() {
  db_delete('variable')
    ->condition('name', 'switchtheme_%', 'LIKE')
    ->execute();
}
?>

But... after disabling and uninstalling the module, it still shows up in the module list and now does not show up in the list of uninstallable modules. And the theme still does not change for user 1 but when I log out it does change for all other users.

Balbo’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Priority: Normal » Major

Still there in 7.x-1.0!

jvieille’s picture

I don't knnow if it is related, but I cannot uninstall this module. I get this error

Fatal error: Call to undefined function db_delete() in .../sites/all/modules/switchtheme/switchtheme.install on line 12

Cory Goodwin’s picture

Priority: Major » Normal
Status: Active » Needs review
Issue tags: +uninstall
FileSize
303 bytes

@ jvieille if you are still having this problem please open up a separate issue.

Attached a patch with johnlaine's fix.

jvieille’s picture

No, it does not seem to help - same error

jvieille’s picture

Similar issue, but different problem for D6
Solution here
https://drupal.org/node/2177305

XTaz’s picture

Issue summary: View changes
function switchtheme_uninstall() {
  db_delete('variable')
//    ->condition('name', 'switchtheme_%', 'LIKE')
//    ->execute;
    ->condition('name', db_like('switchtheme_') . '%', 'LIKE')
    ->execute();
}

solve the problem for me

XTaz’s picture

After reading, SOURCE 1 and SOURCE 2, if variable_del() is not use, it is good to also clear the variable cache :

function switchtheme_uninstall() {
  db_delete('variable')
//    ->condition('name', 'switchtheme_%', 'LIKE')
//    ->execute;
    ->condition('name', db_like('switchtheme_') . '%', 'LIKE')
    ->execute();

  cache_clear_all('variables', 'cache_bootstrap');
}