Fixes for #226, renamed function:
authorRoland Häder <roland@mxchange.org>
Sun, 30 Sep 2012 16:36:02 +0000 (16:36 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 30 Sep 2012 16:36:02 +0000 (16:36 +0000)
- Function isSqlTableCreated() renamed to ifSqlTableExists()
- Fixed bug in ajax-common.js: responseText is now replaced by reply_content
- Possible fixed bug #226 (please test it)
- TODOs.txt updated

DOCS/TODOs.txt
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/extensions/ext-forced.php
inc/install-functions.php
inc/mysql-connect.php
inc/mysql-manager.php
js/ajax-common.js

index dc73f009438eb02d75a7127df68c2470063a1282..ebc0560d0bf7a43b98f1fda439395fa6ad41c0f4 100644 (file)
 ./inc/extensions/ext-network.php:42: * @TODO Yoo!Media: What is LayerAd compared to Layer click?            *
 ./inc/extensions/ext-network.php:99:           // @TODO network_type_handler is an internal name and needs documentation
 ./inc/extensions/ext-newsletter.php:218:               // @TODO Move these into configuration
-./inc/extensions/ext-order.php:389:            // @TODO This should be moved out to inc/daily/
-./inc/extensions/ext-rallye.php:345:           // @TODO Move this code into a hook
 ./inc/extensions/ext-rallye.php:94:            // @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-yoomedia.php:121:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
-./inc/extensions-functions.php:1991:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
+./inc/extensions-functions.php:2005:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
 ./inc/extensions-functions.php:420:    // @TODO This redirect is still needed to register sql_patches! Please try to avoid it
 ./inc/extensions-functions.php:436:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:576:            // @TODO Extension is loaded, what next?
 ./templates/xml/admin/admin_del_do_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
 ./templates/xml/admin/admin_del_show_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
 ### ### template-warnings.log follows: ### ###
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/page_footer.tpl, line: 1 in /media
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/menu/menu_what_end.tpl, line: 1 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/menu/menu_what_end.tpl, line: 2 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/member/member_order_thanks.tpl, line: 12 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/html/member/member_order_thanks.tpl, line: 14 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_order_thanks.tpl, line: 15 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/member/member_content_right.tpl, line: 1 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/member/member_content_right.tpl, line: 5 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_welcome_footer.tpl, line: 1 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_reflink.tpl, line: 29 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/member/member_footer.tpl, line: 6 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/page_footer.tpl, line: 1 in /home
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/admin/admin_main_footer.tpl, line: 1 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_main_footer.tpl, line: 2 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_main_footer.tpl, line: 8 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/admin/admin_main_footer.tpl, line: 9 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/guest/guest_footer.tpl, line: 6 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/guest/guest_menu_content.tpl, line: 2 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/guest/guest_content_footer.tpl, line: 1 in 
 PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/guest/guest_content_footer.tpl, line: 5 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/member/member_footer.tpl, line: 6 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_reflink.tpl, line: 29 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/member/member_content_right.tpl, line: 1 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/member/member_content_right.tpl, line: 5 in 
-PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_welcome_footer.tpl, line: 1 in 
+PHP Warning:  DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/guest/guest_menu_content.tpl, line: 2 in 
index 29b6b9b1bfd279cfaf2f05095f5301eb7815e8ed..17caef397c5f9ee472bf9242c8ddf84df30fb0da 100644 (file)
@@ -584,7 +584,7 @@ function SQL_ERROR ($file, $line, $message) {
 }
 
 // Check if there is a SQL table created
-function isSqlTableCreated ($tableName) {
+function ifSqlTableExists ($tableName) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ' - ENTERED!');
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__][$tableName])) {
index 827762c4c3677c03f1ea37fb1fe6c785fa2262c8..714483dac359db6fb19c53ca17a067dd807d5c48 100644 (file)
@@ -1819,7 +1819,7 @@ function isExtensionFunctionFileReadable ($ext_name) {
 // Adds a CREATE TABLE statement if the requested table is not there
 function addCreateTableSql ($tableName, $sql, $comment) {
        // Is the table not there?
-       if (!isSqlTableCreated($tableName)) {
+       if (!ifSqlTableExists($tableName)) {
                // Is not found, so add it
                addExtensionSql('CREATE TABLE
        `{?_MYSQL_PREFIX?}_' . $tableName . '` (' . $sql . ')
@@ -1836,13 +1836,13 @@ COMMENT ' . chr(39) . $comment . chr(39));
 // Adds a DROP TABLE statement if the requested tabled is there
 function addDropTableSql ($tableName) {
        // Is the table there?
-       if (isSqlTableCreated($tableName)) {
+       if (ifSqlTableExists($tableName)) {
                // Then add it, non-existing tables can be ignored because it will
                // happen with every newly installed extension.
                addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '`');
 
                // Mark it as gone
-               $GLOBALS['isSqlTableCreated'][$tableName] = false;
+               $GLOBALS['ifSqlTableExists'][$tableName] = false;
        } // END - if
 }
 
index 2d4677f3196baad1ac65b8ab167371558a70fc0e..cd1b7579c72a00fe215be052b64a4bbc08f3f199 100644 (file)
@@ -158,7 +158,7 @@ INDEX (`forced_stats_userid`)",
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` LIKE '%forced%'");
 
                // Is earning_data there?
-               if (isSqlTableCreated('earning_data')) {
+               if (ifSqlTableExists('earning_data')) {
                        // Unregister Forced-PopUps from earning_data
                        addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_earning_data` WHERE `earning_provider`='FORCED_POPUP' LIMIT 1");
                } // END - if
index 003feec90f6457b511c12b33c8dde03ba430b6f6..40a6ab62805d0fee38de66b4dacd8cdacfd23365 100644 (file)
@@ -564,7 +564,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
        // So check if all tables are not there
        foreach ($tables as $tableName => $isFound) {
                // Check it out
-               $tables[$tableName] = isSqlTableCreated($tableName);
+               $tables[$tableName] = ifSqlTableExists($tableName);
 
                // Is it (hopefully not) there?
                if ($tables[$tableName] === false) {
index 767227bc65ddec21b4273e279d24903658123bfc..defaaeba0dc67b48953e6435b3e6f72e95bc0d9b 100644 (file)
@@ -120,7 +120,7 @@ if ((!isInstalling()) && (!isInstallationPhase())) {
 
                        // Is it a valid resource?
                        if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === true) {
-                               // Set database name (required for ext-optimize and isSqlTableCreated())
+                               // Set database name (required for ext-optimize and ifSqlTableExists())
                                setConfigEntry('__DB_NAME', $GLOBALS['mysql']['dbase']);
 
                                // Remove MySQL array from namespace
index c72706cbd7a135ae93c65367927a18aca8c93ab6..06901af009f4f6394d02650ac406bb8be74958f6 100644 (file)
@@ -1803,13 +1803,13 @@ function registerExtensionPointsData ($subject, $columnName, $lockedMode, $payme
        $add = '';
 
        // Is the extension equal or newer 0.8.9?
-       if (isExtensionInstalledAndNewer('sql_patches', '0.8.9')) {
+       if ((getExtensionMode() == 'register') || (getExtensionMode() == 'update') || (isExtensionInstalledAndNewer('sql_patches', '0.8.9'))) {
                // Then add provider
                $add = " AND `account_provider`='EXTENSION'";
        } // END - if
 
        // Is the 'subject' there?
-       if (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0) {
+       if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
                // Not found so add an SQL query
                addExtensionSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('%s','%s','%s','%s')",
                        $subject,
index 01c56a9febc6df85b6fdd0c099e5828c71a046af..283e36d82a23defb5b0fdf38592d9a01a896e6a2 100644 (file)
@@ -193,16 +193,16 @@ function sendAjaxRequest (level, doValue, extra, isJson) {
                // Called on success
                success: function (ajax_content) {
                        // Is ajax_content set?
-                       if (ajax_content.responseText == undefined) {
+                       if (ajax_content.reply_content == undefined) {
                                // This shall not happen
-                               throw new 'ajax_content.responseText not returned from ajax.php, please fix your scripts.';
-                       } else if (ajax_content.responseText == null) {
+                               throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+                       } else if (ajax_content.reply_content == null) {
                                // This shall not happen, too
-                               throw new 'ajax_content.responseText=null from ajax.php, please fix your scripts.';
+                               throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
                        }
 
                        // Set AJAX reply
-                       setAjaxReply(ajax_content.responseText, isJson);
+                       setAjaxReply(ajax_content.reply_content, isJson);
 
                        // Mark it as success
                        setAjaxSuccess(true);
@@ -211,16 +211,16 @@ function sendAjaxRequest (level, doValue, extra, isJson) {
                // Called in case of an error (e.g. HTTP response status not '200 OK')
                error: function (ajax_content) {
                        // Is ajax_content set?
-                       if (ajax_content.responseText == undefined) {
+                       if (ajax_content.reply_content == undefined) {
                                // This shall not happen
-                               throw new 'ajax_content.responseText not returned from ajax.php, please fix your scripts.';
-                       } else if (ajax_content.responseText == null) {
+                               throw new 'ajax_content.reply_content not returned from ajax.php, please fix your scripts.';
+                       } else if (ajax_content.reply_content == null) {
                                // This shall not happen, too
-                               throw new 'ajax_content.responseText=null from ajax.php, please fix your scripts.';
+                               throw new 'ajax_content.reply_content=null from ajax.php, please fix your scripts.';
                        }
 
                        // Set AJAX reply
-                       setAjaxReply(ajax_content.responseText, isJson);
+                       setAjaxReply(ajax_content.reply_content, isJson);
                }
        });
 
@@ -379,8 +379,8 @@ function displayErrorWindow (prefix, ajax_content) {
        } // END - if
 
        // Copy the response text to the error variable
-       if (ajax_content.responseText != undefined) {
-               $('#' + prefix + '_error_content').html(ajax_content.responseText);
+       if (ajax_content.reply_content != undefined) {
+               $('#' + prefix + '_error_content').html(ajax_content.reply_content);
        } else {
                $('#' + prefix + '_error_content').html(ajax_content);
        }