Some fixes for bug-mails
authorRoland Häder <roland@mxchange.org>
Thu, 4 Mar 2010 05:41:50 +0000 (05:41 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 4 Mar 2010 05:41:50 +0000 (05:41 +0000)
inc/extensions/ext-yoomedia.php
inc/language/yoomedia_de.php
inc/libs/yoomedia_functions.php
inc/wrapper-functions.php

index 8d1803b..f6b350c 100644 (file)
@@ -124,14 +124,15 @@ UNIQUE `y_type` (`type`,`y_id`)
                $GLOBALS['translation_tables']['yoomedia'] = array(
                        // Error messages
                        'error_codes' => array(
-                               1  => 'wrong_pass',
-                               2  => 'wrong_sid',
-                               3  => 'website_locked',
-                               4  => 'api_data_error',
-                               5  => 'requests_depleted',
-                               6  => 'zero_result',
-                               7  => 'no_campaigns_with_interface',
-                               10 => 'incomplete_request'
+                               -999 => 'unknown_error',
+                               1    => 'wrong_pass',
+                               2    => 'wrong_sid',
+                               3    => 'website_locked',
+                               4    => 'api_data_error',
+                               5    => 'requests_depleted',
+                               6    => 'zero_result',
+                               7    => 'no_campaigns_with_interface',
+                               10   => 'incomplete_request'
                        ),
                        // For text mails
                        'textmail' => array(
index f6fc876..9166767 100644 (file)
@@ -87,6 +87,7 @@ addMessages(array(
        'ADMIN_YOOMEDIA_TM_ACTIONS' => "Aktionen",
 
 // Error messages for admin
+       'ADMIN_YOOMEDIA_ERROR_UNKNOWN' => "Unbekannter/leerer Fehler von API erhalten. M&ouml;glicherweise keine API-Daten angegeben.",
        'ADMIN_YOOMEDIA_ERROR_FAILED' => "Allgemeiner Fehler von API, nicht weiter spezifiziert.",
        'ADMIN_YOOMEDIA_ERROR_TITLE' => "Fehler bei Abfrage der Yoo!Media API 2.0",
        'ADMIN_YOOMEDIA_ERROR_WRONG_PASS' => "Falsches Interfacepasswort angegeben.",
index a91329b..ef00bd8 100644 (file)
@@ -335,7 +335,7 @@ function translateYooMediaError ($errorCode) {
                $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
        } else {
                // Log missing entries
-               debug_report_bug(sprintf("Unknown error code <strong>%s</strong> detected.", $errorCode));
+               debug_report_bug(sprintf("Unknown error code <strong>%s[%s]</strong> detected.", $errorCode, gettype($errorCode)));
        }
 
        // Return value
@@ -360,7 +360,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) {
                if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) {
                        // Remove entry
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_yoomedia_reload` WHERE `id`=%s LIMIT 1",
-                       array($id), __FUNCTION__, __LINE__);
+                               array($id), __FUNCTION__, __LINE__);
                } else {
                        // Dont' sent again this mail
                        $reloaded = $time;
@@ -431,11 +431,17 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) {
 
                // Remove carrige-return
                $code = str_replace("\n", '', $code);
+
        } else {
                // Should not happen!
                debug_report_bug('Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
        }
 
+       // Fix empty code to bad
+       if (empty($code)) {
+               $code = -999;
+       } // END - if
+
        // Return error code
        return $code;
 }
index 43b1b30..c56adab 100644 (file)
@@ -741,7 +741,28 @@ function getPhpCaching () {
 
 // Checks wether the admin hash is set
 function isAdminHashSet ($admin) {
-       if (!isset($GLOBALS['cache_array']['admin'])) debug_report_bug('Cache not set.');
+       /**
+        * @TODO Do we really need this check? If yes, try to fix this:
+        * 1.:functions.php:2504, debug_get_mailable_backtrace(0)
+        * 2.:wrapper-functions.php:744, debug_report_bug(1)
+        * 3.:mysql-manager.php:728, isAdminHashSet(1)
+        * 4.:filters.php:384, isAdmin(0)
+        * 5.:debug_get_mailable_backtrace:2457, FILTER_DETERMINE_USERNAME(1)
+        * 6.:filter-functions.php:280, call_user_func_array(2)
+        * 7.:load_cache.php:74, runFilterChain(1)
+        * 8.:inc-functions.php:131, include(1)
+        * 9.:inc-functions.php:145, loadInclude(1)
+        * 10.:mysql-connect.php:104, loadIncludeOnce(1)
+        * 11.:inc-functions.php:131, include(1)
+        * 12.:inc-functions.php:145, loadInclude(1)
+        * 13.:config-global.php:106, loadIncludeOnce(1)
+        * 14.:js.php:57, require(1)
+        */
+       if (!isset($GLOBALS['cache_array']['admin'])) {
+               debug_report_bug('Cache not set.');
+       } // END - if
+
+       // Check for admin hash
        return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
 }