From: stronk7 Date: Tue, 5 Sep 2006 17:55:59 +0000 (+0000) Subject: Added support to retrofit tables without prefix X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bc942ab58ab2bc0fc9aba408fa1ca53079f73ee4;p=moodle.git Added support to retrofit tables without prefix --- diff --git a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php index 162cb70f1f..df3cd84f8f 100644 --- a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php +++ b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php @@ -131,7 +131,10 @@ class new_table_from_mysql extends XMLDBAction { $table = new XMLDBTable(strtolower(trim($tableparam))); $table->setComment($table->getName() . ' table retrofitted from MySQL'); /// Get fields info from ADODb - $dbfields = $db->MetaColumns($CFG->prefix . $tableparam); + if(!$dbfields = $db->MetaColumns($CFG->prefix . $tableparam)) { + ///Try it without prefix if doesn't exist + $dbfields = $db->MetaColumns($tableparam); + } if ($dbfields) { foreach ($dbfields as $dbfield) { /// Create new XMLDB field