summaryrefslogtreecommitdiff
path: root/modules/trigger
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-03-26 21:56:50 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-03-26 21:56:50 -0700
commit505974084d248ebcbb225fe328409ef59a9d4e5a (patch)
tree6fcb33d4dce25fb1c7100c4aed823b8b1ced674a /modules/trigger
parent039a66c042b6c6667fff5108b59fcec2eb5f7cff (diff)
downloadbrdo-505974084d248ebcbb225fe328409ef59a9d4e5a.tar.gz
brdo-505974084d248ebcbb225fe328409ef59a9d4e5a.tar.bz2
Issue #1280792 by xjm, julien, BTMash, pingers, AntoineSolutions, tim.plunkett, Niklas Fiekas: Fixed {trigger_assignments()}.hook has only 32 characters, is too short.
Diffstat (limited to 'modules/trigger')
-rw-r--r--modules/trigger/trigger.install15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install
index 5ed40776b..4deecf3af 100644
--- a/modules/trigger/trigger.install
+++ b/modules/trigger/trigger.install
@@ -55,9 +55,15 @@ function trigger_install() {
}
/**
- * Adds operation names to the hook names and drops the "op" field.
+ * Alter the "hook" field and drop the "op field" of {trigger_assignments}.
+ *
+ * Increase the length of the "hook" field to 78 characters and adds operation
+ * names to the hook names, and drops the "op" field.
*/
function trigger_update_7000() {
+ 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.'));
+
$result = db_query("SELECT hook, op, aid FROM {trigger_assignments} WHERE op <> ''");
foreach ($result as $record) {
@@ -69,10 +75,15 @@ function trigger_update_7000() {
->execute();
}
db_drop_field('trigger_assignments', 'op');
+
+ db_add_primary_key('trigger_assignments', array('hook', 'aid'));
}
/**
- * Increase length of hook name field to 78 characters.
+ * Increase the length of the "hook" field to 78 characters.
+ *
+ * This is a separate function for those who ran an older version of
+ * trigger_update_7000() that did not do this.
*/
function trigger_update_7001() {
db_drop_primary_key('trigger_assignments');