// Small fix (module installation and pscleaner)

This commit is contained in:
Damien Metzger committed 2013-03-11 12:31:42 +01:00
1 parent dfba5630d2
commit fdeba0497d
2 files changed
+6 -4

No files matched your search

+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');
+4 -3
View File
@@ -244,14 +244,15 @@ 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]))
continue;
$query = 'DELETE FROM `'._DB_PREFIX_.$query_array[0].'` WHERE `'.$query_array[1].'` NOT IN (SELECT `'.$query_array[3].'` FROM `'._DB_PREFIX_.$query_array[2].'`)'; $query = 'DELETE FROM `'._DB_PREFIX_.$query_array[0].'` WHERE `'.$query_array[1].'` NOT IN (SELECT `'.$query_array[3].'` FROM `'._DB_PREFIX_.$query_array[2].'`)';
$db->Execute($query); $db->Execute($query);
if ($affected_rows = $db->Affected_Rows()) if ($affected_rows = $db->Affected_Rows())
$logs[$query] = $affected_rows; $logs[$query] = $affected_rows;
} }
}
// _lang table cleaning // _lang table cleaning
$tables = Db::getInstance()->executeS('SHOW TABLES LIKE "'._DB_PREFIX_.'%_\\_lang"'); $tables = Db::getInstance()->executeS('SHOW TABLES LIKE "'._DB_PREFIX_.'%_\\_lang"');