Index: install.php =================================================================== --- install.php (revision 13329) +++ install.php (working copy) @@ -1181,6 +1181,30 @@ } /** + * Virtually place module under "modules" folder or it won't be recognized during upgrade to 5.1.0 version + * + * @param string $name + * @param string $path + * @param string $version + * @return string + */ + function getModulePath($name, $path, $version) + { + if ($name == 'Core') { + // don't transform path for Core module + return $path; + } + + $version = $this->toolkit->ConvertModuleVersion($version); + + if ($version < $this->toolkit->ConvertModuleVersion('5.1.0')) { + return 'modules/' . $path; + } + + return $path; + } + + /** * Returns list of modules, that can be upgraded * */ @@ -1194,7 +1218,9 @@ continue; } + $module_info['Path'] = $this->getModulePath($module_name, $module_info['Path'], $module_info['Version']); $upgrades_file = sprintf(UPGRADES_FILE, $module_info['Path'], 'sql'); + if (!file_exists($upgrades_file)) { // no upgrade file continue; Index: install/install_toolkit.php =================================================================== --- install/install_toolkit.php (revision 13329) +++ install/install_toolkit.php (working copy) @@ -310,6 +310,7 @@ $sqls = str_replace('CREATE TABLE ', 'CREATE TABLE IF NOT EXISTS ' . $table_prefix, $sqls); $sqls = str_replace('DROP TABLE ', 'DROP TABLE IF EXISTS ' . $table_prefix, $sqls); $sqls = str_replace('<%TABLE_PREFIX%>', $table_prefix, $sqls); + $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $this->Application->GetDefaultLanguageId(), $sqls); if (isset($replace_from) && isset($replace_to)) { // replace something additionally, e.g. module root category @@ -591,12 +592,17 @@ /** * Returns information about module (based on "install/module_info.xml" file) * - * @param string $module_folder + * @param string $module_name * @return Array */ - function getModuleInfo($module_folder) + function getModuleInfo($module_name) { - $info_file = MODULES_PATH . '/' . $module_folder . '/install/module_info.xml'; + if ($module_name == 'core') { + $info_file = FULL_PATH . '/' . $module_name . '/install/module_info.xml'; + } + else { + $info_file = MODULES_PATH . '/' . $module_name . '/install/module_info.xml'; + } if (!file_exists($info_file)) { return Array (); @@ -625,22 +631,22 @@ /** * Returns nice module string to be used on install/upgrade screens * - * @param string $module_folder + * @param string $module_name * @param string $version_string * @return string */ - function getModuleString($module_folder, $version_string) + function getModuleString($module_name, $version_string) { // image (if exists) ( ) $ret = Array (); - $module_info = $this->getModuleInfo($module_folder); + $module_info = $this->getModuleInfo($module_name); if (array_key_exists('name', $module_info) && $module_info['name']) { $module_name = $module_info['name']; } else { - $module_name = $this->getModuleName($module_folder); + $module_name = $this->getModuleName($module_name); } if (array_key_exists('image', $module_info) && $module_info['image']) {