Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Quickmail: fix upgrade failure point #41

Merged
merged 1 commit into from
Jun 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
6 changes: 4 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down