diff options
Diffstat (limited to 'modules/trigger')
-rw-r--r-- | modules/trigger/trigger.install | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install index 4deecf3af..20d5c3a3d 100644 --- a/modules/trigger/trigger.install +++ b/modules/trigger/trigger.install @@ -89,3 +89,19 @@ function trigger_update_7001() { db_drop_primary_key('trigger_assignments'); db_change_field('trigger_assignments', 'hook', 'hook', array('type' => 'varchar', 'length' => 78, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.', ), array('primary key' => array('hook', 'aid'))); } + +/** + * Renames nodeapi to node. + */ +function trigger_update_7002() { + $result = db_query("SELECT hook, aid FROM {trigger_assignments}"); + + foreach($result as $record) { + $new_hook = str_replace('nodeapi', 'node', $record->hook); + db_update('trigger_assignments') + ->fields(array('hook' => $new_hook)) + ->condition('hook', $record->hook) + ->condition('aid', $record->aid) + ->execute(); + } +} |