The current hook_uninstall function is currently:

function panelizer_uninstall() {
  db_delete('variable')
    ->condition('name', 'panelizer_defaults_%')
    ->execute();
  db_delete('variable')
    ->condition('name', 'panelizer_node:%')
    ->execute();
}

Resulting in the query: DELETE FROM {variable} WHERE name = 'panelizer_defaults_%'

The conditions need to have the 'LIKE' added as a third argument.

function panelizer_uninstall() {
  db_delete('variable')
    ->condition('name', 'panelizer_defaults_%', 'LIKE')
    ->execute();
  db_delete('variable')
    ->condition('name', 'panelizer_node:%', 'LIKE')
    ->execute();
}

Resulting in the query: DELETE FROM {variable} WHERE name LIKE 'panelizer_defaults_%'

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamestombs’s picture

Status: Active » Needs review
FileSize
530 bytes

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 1: panelizer_fix_hook_uninstall-2198363-1.patch, failed testing.

jamestombs’s picture

Status: Needs work » Needs review
FileSize
516 bytes

Try again...

DamienMcKenna’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Related issues: +#2190839: hook_uninstall should properly uninstall all variables

This is a worthwhile stepping stone towards #2190839: hook_uninstall should properly uninstall all variables. I'll review it later, thanks.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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