Index: branches/5.1.x/core/install/install_toolkit.php =================================================================== diff -u -N -r13168 -r13189 --- branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 13168) +++ branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 13189) @@ -1,6 +1,6 @@ GetMaxModuleVersion($module_name); + if (!$module_path) { + trigger_error('Module path must be given to "SetModuleVersion" method to auto-detect version', E_USER_ERROR); + return ; + } + + $version = $this->GetMaxModuleVersion($module_path); } // get table prefix from config, because application may not be available here @@ -234,9 +240,11 @@ * @param string $module_name * @return string */ - function GetMaxModuleVersion($module_name) + function GetMaxModuleVersion($module_path) { - $upgrades_file = sprintf(UPGRADES_FILE, mb_strtolower($module_name).'/', 'sql'); + $module_path = rtrim(mb_strtolower($module_path), '/'); + $upgrades_file = sprintf(UPGRADES_FILE, $module_path . '/', 'sql'); + if (!file_exists($upgrades_file)) { // no upgrade file return '5.0.0'; @@ -815,12 +823,12 @@ */ function finalizeModuleInstall($module_folder, $refresh_permissions = false) { + $this->SetModuleVersion(basename($module_folder), $module_folder); + if (!$this->Application->GetVar('redirect')) { return ; } - $this->SetModuleVersion($module_folder); - $this->deleteCache($refresh_permissions); $url_params = Array (