From e7b0f082c97b132551d3895d028b93217603ee8c Mon Sep 17 00:00:00 2001 From: Charles Fulton Date: Wed, 6 Jun 2012 12:57:01 -0700 Subject: [PATCH] Quickmail: fix upgrade failure point --- config_form.php | 2 +- db/upgrade.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config_form.php b/config_form.php index 26b6434d..a474001d 100644 --- a/config_form.php +++ b/config_form.php @@ -13,7 +13,7 @@ public function definition() { 'courseid' => $this->_customdata['courseid'], 'reset' => 1 )), quickmail::_s('reset') - ); + ); $mform->addElement('static', 'reset', '', $reset_link); $student_select = array(0 => get_string('no'), 1 => get_string('yes')); diff --git a/db/upgrade.php b/db/upgrade.php index 50779227..89e5c86e 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -39,13 +39,15 @@ function xmldb_block_quickmail_upgrade($oldversion) { $table->addKey($key); - $dbman->create_table($table); + if (!$dbman->table_exists($table)) { + $dbman->create_table($table); + } foreach (array('log', 'drafts') as $table) { // Define field alternateid to be added to block_quickmail_log $table = new xmldb_table('block_quickmail_' . $table); $field = new xmldb_field('alternateid', XMLDB_TYPE_INTEGER, '10', - XMLDB_UNSIGNED, null, null, 'NULL', 'userid'); + XMLDB_UNSIGNED, null, null, null, 'userid'); // Conditionally launch add field alternateid if (!$dbman->field_exists($table, $field)) {