Fix for failed cache tries, problems with modules are locked
[mailer.git] / inc / mysql-manager.php
index 89d3d5e44f6eba5690755dd57baf50c9532b3a23..7a4e9833adb57d38c63fa226e44989630bb21d61 100644 (file)
@@ -105,7 +105,7 @@ function CHECK_MODULE ($mod) {
 
        // Check if cache is latest version
        $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
-       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (is_array($cacheArray['modules']['module']))) {
+       if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Is the module cached?
                if (isset($cacheArray['modules']['locked'][$mod_chk])) {
                        // Check cache
@@ -153,7 +153,7 @@ function CHECK_MODULE ($mod) {
        } // END - if
 
        // Still no luck or not found?
-       if (($ret == "major") || ($ret == "cache_miss") || (!$found)) {
+       if (($ret == "cache_miss") || (!$found)) {
                //              ----- Legacy module -----                                   ---- Module in base folder  ----                       --- Module with extension's name ---
                if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", PATH, $extension, $mod)))) {
                        // Data is missing so we add it
@@ -185,7 +185,17 @@ function CHECK_MODULE ($mod) {
                        // Module not found we don't add it to the database
                        $ret = "404";
                }
-       } // END - if
+       } elseif (!$found) {
+               // Problem with module detected
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. ret=%s, locked=%s, hidden=%s, mem=%s, admin=%s",
+                       $mod,
+                       $ret,
+                       $locked,
+                       $hidden,
+                       $mem,
+                       $admin
+               ));
+       }
 
        // Return the value
        return $ret;