From: Roland Häder Date: Sun, 30 Sep 2012 16:36:02 +0000 (+0000) Subject: Fixes for #226, renamed function: X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=b622c2d9285f044f49328cbd98efbf2f1a24aa8e Fixes for #226, renamed function: - 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 --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index dc73f00943..ebc0560d0b 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -40,12 +40,10 @@ ./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? @@ -510,19 +508,22 @@ ./templates/xml/admin/admin_del_do_surfbar_urls.xml:1: ./templates/xml/admin/admin_del_show_surfbar_urls.xml:1: ### ### 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 diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 29b6b9b1bf..17caef397c 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -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])) { diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 827762c4c3..714483dac3 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -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 } diff --git a/inc/extensions/ext-forced.php b/inc/extensions/ext-forced.php index 2d4677f319..cd1b7579c7 100644 --- a/inc/extensions/ext-forced.php +++ b/inc/extensions/ext-forced.php @@ -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 diff --git a/inc/install-functions.php b/inc/install-functions.php index 003feec90f..40a6ab6280 100644 --- a/inc/install-functions.php +++ b/inc/install-functions.php @@ -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) { diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 767227bc65..defaaeba0d 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -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 diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index c72706cbd7..06901af009 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -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, diff --git a/js/ajax-common.js b/js/ajax-common.js index 01c56a9feb..283e36d82a 100644 --- a/js/ajax-common.js +++ b/js/ajax-common.js @@ -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); }