Index: branches/5.1.x/core/install/install_toolkit.php =================================================================== diff -u -N -r12657 -r13086 --- branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 12657) +++ branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 13086) @@ -1,6 +1,6 @@ ', $table_prefix, $sqls); if (isset($replace_from) && isset($replace_to)) { // replace something additionally, e.g. module root category @@ -370,18 +371,37 @@ } /** - * Converts module version in format X.Y.Z to signle integer + * Converts module version in format X.Y.Z[-BN/-RCM] to signle integer * * @param string $version * @return int */ function ConvertModuleVersion($version) { - $parts = explode('.', $version); + if (preg_match('/(.*)-(B|RC)([\d]+)/', $version, $regs)) { + // -B or RC- + $parts = explode('.', $regs[1]); + $parts[] = $regs[2] == 'B' ? 1 : 2; // B reliases goes before RC releases + $parts[] = $regs[3]; + } + else { + // releases without B/RC marks go after any B/RC releases + $parts = explode('.', $version . '.3.100'); + } + $bin = ''; - foreach ($parts as $part) { - $bin .= str_pad(decbin($part), 8, '0', STR_PAD_LEFT); + + foreach ($parts as $part_index => $part) { + if ($part_index == 3) { + // version type only can be 1/2/3 (11 in binary form), so don't use padding at all + $pad_count = 2; + } + else { + $pad_count = 8; + } + + $bin .= str_pad(decbin($part), $pad_count, '0', STR_PAD_LEFT); } return bindec($bin); @@ -403,7 +423,8 @@ $table_name = $this->Application->getUnitOption('theme', 'TableName'); $sql = 'SELECT Name, ' . $id_field . ' - FROM ' . $table_name . 'ORDER BY Name ASC'; + FROM ' . $table_name . ' + ORDER BY Name ASC'; return $this->Conn->GetCol($sql, $id_field); } @@ -769,9 +790,11 @@ function deleteCache($refresh_permissions = false) { $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Cache - WHERE VarName IN ("config_files", "configs_parsed", "sections_parsed", "cms_menu", "StructureTree")'; + WHERE VarName IN ("config_files", "configs_parsed", "sections_parsed")'; $this->Conn->Query($sql); + $this->Application->HandleEvent($event, 'c:OnResetCMSMenuCache'); + if ($refresh_permissions) { if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) { // refresh permission without progress bar