summaryrefslogtreecommitdiff
path: root/modules/trigger
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-04 10:07:00 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-04 10:07:00 -0700
commit4489759b74ac1a2cd9d0fc45982147746145219b (patch)
treee3a3ae13674081801ec41b92938c4fefe00f80df /modules/trigger
parent1775766e3495d6aa905aec90752ce2c44bf62a2f (diff)
downloadbrdo-4489759b74ac1a2cd9d0fc45982147746145219b.tar.gz
brdo-4489759b74ac1a2cd9d0fc45982147746145219b.tar.bz2
Issue #1280792 follow-up BTMash, irunflower, Zgear: Fixed Trigger upgrade path: Node triggers removed when upgrading to 7-dev from 6.25.
Diffstat (limited to 'modules/trigger')
-rw-r--r--modules/trigger/trigger.install16
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();
+ }
+}