// Small fix (module installation and pscleaner)

This commit is contained in:
Damien Metzger
2013-03-11 12:31:42 +01:00
parent dfba5630d2
commit fdeba0497d
2 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -599,7 +599,7 @@ class AdminModulesControllerCore extends AdminController
} }
// If Addons module, download and unzip it before installing it // If Addons module, download and unzip it before installing it
if (!is_dir('../modules/'.$name.'/')) if (!file_exists('../modules/'.$name.'/'.$name.'.php'))
{ {
$filesList = array( $filesList = array(
array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0), array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0),
@@ -623,6 +623,7 @@ class AdminModulesControllerCore extends AdminController
} }
} }
} }
// Check potential error // Check potential error
if (!($module = Module::getInstanceByName(urldecode($name)))) if (!($module = Module::getInstanceByName(urldecode($name))))
$this->errors[] = $this->l('Module not found'); $this->errors[] = $this->l('Module not found');
+8 -7
View File
@@ -244,13 +244,14 @@ class PSCleaner extends Module
$queries = self::bulle($queries); $queries = self::bulle($queries);
foreach ($queries as $query_array) foreach ($queries as $query_array)
{ {
if(!isset($query_array[4]) || (isset($query_array[4]) && Module::isInstalled($query_array[4]))) // If this is a module and the module is not installed, we continue
{ if (isset($query_array[4]) && !Module::isInstalled($query_array[4]))
$query = 'DELETE FROM `'._DB_PREFIX_.$query_array[0].'` WHERE `'.$query_array[1].'` NOT IN (SELECT `'.$query_array[3].'` FROM `'._DB_PREFIX_.$query_array[2].'`)'; continue;
$db->Execute($query);
if ($affected_rows = $db->Affected_Rows()) $query = 'DELETE FROM `'._DB_PREFIX_.$query_array[0].'` WHERE `'.$query_array[1].'` NOT IN (SELECT `'.$query_array[3].'` FROM `'._DB_PREFIX_.$query_array[2].'`)';
$logs[$query] = $affected_rows; $db->Execute($query);
} if ($affected_rows = $db->Affected_Rows())
$logs[$query] = $affected_rows;
} }
// _lang table cleaning // _lang table cleaning