From 2439bedff8b2571c8416d9138a47e248da067033 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 25 Apr 2008 15:18:54 +0000 Subject: [PATCH] MDL-14484 rerun asearchtemplate upgrade - there were reported problems on some sites --- mod/data/db/upgrade.php | 12 ++++++++++++ mod/data/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index feea212596a27..f7f7a65d89462 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -97,6 +97,18 @@ function xmldb_data_upgrade($oldversion=0) { } } + if ($result && $oldversion < 2007101512) { + /// Launch add field asearchtemplate again if does not exists yet - reported on several sites + + $table = new XMLDBTable('data'); + $field = new XMLDBField('asearchtemplate'); + $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'jstemplate'); + + if (!field_exists($table, $field)) { + $result = $result && add_field($table, $field); + } + } + return $result; } diff --git a/mod/data/version.php b/mod/data/version.php index b399e7a1af9ed..04777774f3e0f 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2007101511; +$module->version = 2007101512; $module->requires = 2007101509; // Requires this Moodle version $module->cron = 60;