From a84634a1d48f82268ce497a5351f755ad55a2537 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 10 Sep 2006 18:53:47 +0000 Subject: [PATCH] improved display of errors... --- admin/xmldb/actions/test/test.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/admin/xmldb/actions/test/test.class.php b/admin/xmldb/actions/test/test.class.php index d62b81a260..00b9b64065 100644 --- a/admin/xmldb/actions/test/test.class.php +++ b/admin/xmldb/actions/test/test.class.php @@ -107,7 +107,8 @@ class test extends XMLDBAction { $table->addIndexInfo('rsstype', XMLDB_INDEX_UNIQUE, array('rsstype')); /// Get SQL code and execute it - $test->sql = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, false); + $test = new stdClass; + $test->sql = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, true); $test->status = create_table($table, false, false); if (!$test->status) { $test->error = $db->ErrorMsg(); @@ -117,7 +118,8 @@ class test extends XMLDBAction { /// 2nd test. drop table if ($test->status) { /// Get SQL code and execute it - $test->sql = $table->getDropTableSQL($CFG->dbtype, $CFG->prefix, false); + $test = new stdClass; + $test->sql = $table->getDropTableSQL($CFG->dbtype, $CFG->prefix, true); $test->status = drop_table($table, false, false); if (!$test->status) { $test->error = $db->ErrorMsg(); @@ -133,7 +135,8 @@ class test extends XMLDBAction { $table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id')); $table->addKeyInfo('course', XMLDB_KEY_FOREIGN, array('course'), 'course', array('id')); /// Get SQL code and execute it - $test->sql = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, false); + $test = new stdClass; + $test->sql = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, true); $test->status = create_table($table, false, false); if (!$test->status) { $test->error = $db->ErrorMsg(); @@ -148,7 +151,8 @@ class test extends XMLDBAction { foreach ($tests as $key => $test) { $o .= '
  • ' . $key . ($test->status ? ' Ok' : ' Error'); if (!$test->status) { - $o .= '
    ' . $test->sql . '
    '; + $o .= '
    ' . $test->error . ''; + $o .= '
    ' . implode('
    ', $test->sql) . '
    '; } $o .= '
  • '; } -- 2.39.5