More debug output added
authorRoland Häder <roland@mxchange.org>
Sat, 6 Jun 2009 19:38:38 +0000 (19:38 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 6 Jun 2009 19:38:38 +0000 (19:38 +0000)
inc/extensions.php
inc/modules/admin/overview-inc.php

index b0b7df12910c1bc6c50e5c43a87650c100ef0f8a..fb0ae03c511e1e3db6ad53ad29c7b2936689869f 100644 (file)
@@ -579,7 +579,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
 }
 
 // Output verbose SQL table for extension
 }
 
 // Output verbose SQL table for extension
-function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = '', $dashed = '', $switch = false, $width = "100%") {
+function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = '', $dashed = '', $switch = false, $width = '100%') {
        // Empty title?
        if (empty($title)) {
                // Then fix it to default
        // Empty title?
        if (empty($title)) {
                // Then fix it to default
index ccaaa3f03467608e4013ea4e2bed1563e12b0906..856454cffb38237950f0b7790baf212cb22210ad 100644 (file)
@@ -169,7 +169,10 @@ LIMIT 1",
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
                                if (((GET_EXT_VERSION('sql_patches') != '') && (getConfig('verbose_sql') == 'Y')) || (!EXT_IS_ACTIVE('sql_patches'))) {
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
                                if (((GET_EXT_VERSION('sql_patches') != '') && (getConfig('verbose_sql') == 'Y')) || (!EXT_IS_ACTIVE('sql_patches'))) {
+                                       // Extract extension name from subject
                                        $ext_name = substr($subj, 1, strpos($subj, ':') - 1);
                                        $ext_name = substr($subj, 1, strpos($subj, ':') - 1);
+
+                                       // Update task or extension task?
                                        if ($type == 'EXTENSION') {
                                                // Load SQL commands for registering
                                                REGISTER_EXTENSION($ext_name, $id, true);
                                        if ($type == 'EXTENSION') {
                                                // Load SQL commands for registering
                                                REGISTER_EXTENSION($ext_name, $id, true);
@@ -183,7 +186,7 @@ LIMIT 1",
                                                // Prepare extension name and version
                                                $ext_name = substr($ext_name, 7);
                                                $ext_name = substr($ext_name, 0, strpos($ext_name, '-'));
                                                // Prepare extension name and version
                                                $ext_name = substr($ext_name, 7);
                                                $ext_name = substr($ext_name, 0, strpos($ext_name, '-'));
-                                               $test = '[UPDATE-'.$ext_name.'-';
+                                               $test = '[UPDATE-' . $ext_name . '-';
                                                $ext_ver = substr($subj, strlen($test));
                                                $ext_ver = substr($ext_ver, 0, strpos($ext_ver, ':'));
 
                                                $ext_ver = substr($subj, strlen($test));
                                                $ext_ver = substr($ext_ver, 0, strpos($ext_ver, ':'));
 
@@ -200,12 +203,13 @@ LIMIT 1",
                                                $ext_name = '';
                                        }
 
                                                $ext_name = '';
                                        }
 
-                                       // Add SQLs to a table
+                                       // Auto-init SQL handler
                                        if (!IS_SQLS_VALID()) INIT_SQLS();
                                        if (!IS_SQLS_VALID()) INIT_SQLS();
-                                       if (empty($title)) $title = '';
+
+                                       // Add SQLs to a table
                                        if ((!empty($ext_name)) && (GET_EXT_VERSION('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
                                                // Add verbose SQL table
                                        if ((!empty($ext_name)) && (GET_EXT_VERSION('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
                                                // Add verbose SQL table
-                                               $text .= EXTENSION_VERBOSE_TABLE($title, " class=\"admin_table top2 left2 right2\"", true, "100%")."<br />\n";
+                                               $text .= EXTENSION_VERBOSE_TABLE($title, " class=\"admin_table top2 left2 right2\"", true, '100%')."<br />\n";
                                        } // END - if
                                } elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
                                        // Run SQL commands in dry mode but only return the notes
                                        } // END - if
                                } elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
                                        // Run SQL commands in dry mode but only return the notes
@@ -213,7 +217,7 @@ LIMIT 1",
                                        $text .= EXT_GET_NOTES();
                                } else {
                                        // This should not normally happen!
                                        $text .= EXT_GET_NOTES();
                                } else {
                                        // This should not normally happen!
-                                       debug_report_bug('ext_name(' . $ext_name . ') or ext_ver (' . $ext_ver . ') is empty!');
+                                       debug_report_bug('ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . GET_EXT_VERSION('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
                                }
 
                                // Prepare array for the template
                                }
 
                                // Prepare array for the template