Index: branches/unlabeled/unlabeled-1.26.2/kernel/units/languages/languages_event_handler.php =================================================================== diff -u -r5439 -r5732 --- branches/unlabeled/unlabeled-1.26.2/kernel/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 5439) +++ branches/unlabeled/unlabeled-1.26.2/kernel/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 5732) @@ -212,7 +212,7 @@ $lang_xml =& $this->Application->recallObject('LangXML'); $lang_xml->Parse($filename, $field_values['PhraseType'], $modules, $field_values['ImportOverwrite']); - $event->redirect = 'dummy'; + $event->redirect = true; $event->SetRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'mode'=>$field_values['ImportOverwrite']) ); } else Index: branches/unlabeled/unlabeled-1.26.2/core/units/languages/languages_event_handler.php =================================================================== diff -u -r5439 -r5732 --- branches/unlabeled/unlabeled-1.26.2/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 5439) +++ branches/unlabeled/unlabeled-1.26.2/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 5732) @@ -212,7 +212,7 @@ $lang_xml =& $this->Application->recallObject('LangXML'); $lang_xml->Parse($filename, $field_values['PhraseType'], $modules, $field_values['ImportOverwrite']); - $event->redirect = 'dummy'; + $event->redirect = true; $event->SetRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'mode'=>$field_values['ImportOverwrite']) ); } else Index: branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php =================================================================== diff -u -r4886 -r5732 --- branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php (.../install_lib.php) (revision 4886) +++ branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php (.../install_lib.php) (revision 5732) @@ -49,6 +49,8 @@ { $dir = @dir($admindirname.'/install/upgrades'); + if (!$dir) return ''; + $upgrades_arr = Array(); $version = ''; @@ -926,7 +928,7 @@ $app->Redirect('', Array('pass' => 'all', 'admin' => 1, 'Refresh' => 1), '', 'modules/mod_status.php'); } - + /** * [UPGRADE] Initializes [cached] category/item templates with default values for each module * @@ -938,26 +940,26 @@ { $table_prefix = GetTablePrefix(); $inst_ado =& inst_GetADODBConnection(); - + // get module root category by module name $sql = 'SELECT RootCat FROM '.$table_prefix.'Modules WHERE Name = '.$inst_ado->qstr($module); $module_root = $inst_ado->GetOne($sql); - + // set category & item template to module root category $sql = 'UPDATE '.$table_prefix.'Category SET CategoryTemplate = '.$inst_ado->qstr($category_template).', ItemTemplate = '.$inst_ado->qstr($item_template).' WHERE CategoryId = '.$module_root; $inst_ado->Execute($sql); - + // set cached category & item templates to all sub-categories of module root category $sql = 'UPDATE '.$table_prefix.'Category SET CachedCategoryTemplate = '.$inst_ado->qstr($category_template).', CachedItemTemplate = '.$inst_ado->qstr($item_template).' WHERE ParentPath LIKE "|'.$module_root.'|%'; $inst_ado->Execute($sql); } - + /** * [UPGRADE] Moves custom field values for prefix specified from CustomMetaData table to prefix dependant separate table * @@ -966,50 +968,50 @@ function convertCustomFields($prefix) { $application =& kApplication::Instance(); - + $ml_helper =& $application->recallObject('kMultiLanguageHelper'); $ml_helper->createFields($prefix.'-cdata', true); - + $db =& $application->GetADODBConnection(); - + $custom_fields = $application->getUnitOption($prefix, 'CustomFields'); if (!$custom_fields) { return true; } - + $custom_table = $application->getUnitOption($prefix.'-cdata', 'TableName'); - + // copy value from Value field to l_Value field, where destination field is empty $m_lang = $application->GetVar('m_lang'); $sql = 'UPDATE '.TABLE_PREFIX.'CustomMetaData SET l'.$m_lang.'_Value = Value WHERE LENGTH(l'.$m_lang.'_Value) = 0'; $db->Query($sql); - + $i = 1; $field_mask = ''; $language_count = $ml_helper->getLanguageCount(); while ($i <= $language_count) { - $field_mask .= 'cdata%1$s.l'.$i.'_Value AS l'.$i.'_cust_%1$s, '; + $field_mask .= 'cdata%1$s.l'.$i.'_Value AS l'.$i.'_cust_%1$s, '; $i++; } $field_mask = preg_replace('/(.*), $/', '\\1', $field_mask); - + $join_mask = 'LEFT JOIN '.TABLE_PREFIX.'CustomMetaData cdata%1$s ON main_table.ResourceId = cdata%1$s.ResourceId AND cdata%1$s.CustomFieldId = %1$s'; - + $fields_sql = Array(); $joins_sql = Array(); foreach ($custom_fields as $custom_id => $custom_name) { array_push($fields_sql, sprintf($field_mask, $custom_id) ); array_push($joins_sql, sprintf($join_mask, $custom_id)); } - - $sql = 'INSERT INTO '.$custom_table.' + + $sql = 'INSERT INTO '.$custom_table.' SELECT 0 AS CustomDataId, main_table.ResourceId, '.implode(', ', $fields_sql).' FROM '.$application->getUnitOption($prefix, 'TableName').' main_table '.implode(' ', $joins_sql); $db->Query($sql); } - + /** * [INSTALL] Link custom field records with search config records + create custom field columns * @@ -1030,13 +1032,13 @@ WHERE (TableName = "CustomField") AND (LOWER(ModuleName) = "'.strtolower($module_name).'") AND (FieldName = '.$db->qstr($cf_name).')'; $db->Query($sql); } - + $application->refreshModuleInfo(); // this module configs are now processed - + // because of configs was read only from installed before modules (in-portal), then reread configs $unit_config_reader =& $application->recallObject('kUnitConfigReader'); $unit_config_reader->scanModules(MODULES_PATH.'/'.strtolower($module_name)); - + // create correct columns in ProductsCustomData table $ml_helper =& $application->recallObject('kMultiLanguageHelper'); $ml_helper->createFields($prefix.'-cdata', true); Index: branches/unlabeled/unlabeled-1.106.2/admin/install.php =================================================================== diff -u -r5432 -r5732 --- branches/unlabeled/unlabeled-1.106.2/admin/install.php (.../install.php) (revision 5432) +++ branches/unlabeled/unlabeled-1.106.2/admin/install.php (.../install.php) (revision 5732) @@ -528,6 +528,8 @@ $dir_name = $pathtoroot.$mod_path."/admin/install/upgrades/"; $dir = @dir($dir_name); + if (!$dir) continue; + $upgrades_arr = Array(); $new_version = ''; @@ -709,7 +711,7 @@ $objThemes->CreateMissingThemes(false); $css_hash = $application->Conn->GetCol('SELECT LOWER(Name) AS Name, StylesheetId FROM '.TABLE_PREFIX.'Stylesheets', 'StylesheetId'); - + $css_table = $application->getUnitOption('css','TableName'); $css_idfield = $application->getUnitOption('css','IDField'); Index: branches/unlabeled/unlabeled-1.50.2/kernel/include/modules.php =================================================================== diff -u -r5498 -r5732 --- branches/unlabeled/unlabeled-1.50.2/kernel/include/modules.php (.../modules.php) (revision 5498) +++ branches/unlabeled/unlabeled-1.50.2/kernel/include/modules.php (.../modules.php) (revision 5732) @@ -35,7 +35,7 @@ else { $env_sections = explode(':', $env); - + $main = array_shift($env_sections); if($main) { @@ -55,7 +55,7 @@ $var_list['t'] = $template; if( getArrayValue($_GET, 'dest') ) $var_list['dest'] = $_GET['dest']; } - + foreach ($env_sections as $env_section) { $env_section = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $env_section); @@ -68,7 +68,7 @@ } } - + } if(!$SessionQueryString) $var_list['sid'] = $_COOKIE[SESSION_COOKIE_NAME]; @@ -77,7 +77,7 @@ function LoadEnv() { global $env, $var_list, $mod_prefix,$objSession; - + $env = $_GET["env"]; // echo "Loading Variables..
\n"; if ($env != "") @@ -224,7 +224,7 @@ $url_params = Array('t' => $t); $app =& kApplication::Instance(); $app->SetVar('prefixes_passed', Array() ); - + if( is_array($mod_prefix) ) { foreach($mod_prefix as $key => $value) @@ -240,7 +240,7 @@ } } } - + $url_params['pass'] = implode( ',', $app->GetVar('prefixes_passed') ); return $url_params; } @@ -559,7 +559,7 @@ foreach ($vars as $config_key => $config_value) { $GLOBALS['g_'.$config_key] = $config_value; } - + $lic = base64_decode($GLOBALS['g_License']); _ParseLicense($lic); @@ -798,7 +798,9 @@ $mod = $pathtoroot . $value . "parser.php"; // LogEntry("Loading parser $mod \n"); - require_once($mod); + if (file_exists($mod)) { // k4 modules may have no parser.php + require_once($mod); + } } } @@ -863,10 +865,10 @@ if($Action == 'm_logout') { $u = new clsUserSession($var_list['sid'] ,($SessionQueryString && $FrontEnd==1)); - + $application =& kApplication::Instance(); $application->HandleEvent( new kEvent('u:OnInpLogout') ); - + $u->Logout(); unset($u); $var_list_update['t'] = 'index'; @@ -962,7 +964,7 @@ { $var_to_global = $key.'_var_list'; global $$var_to_global; - + $application =& kApplication::Instance(); // just to sure, that object is here in all actions if($FrontEnd == 0 || !is_numeric($FrontEnd) || $FrontEnd == 2) { $rootURL = 'http://'.ThisDomain().$objConfig->Get('Site_Path');