Index: branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php =================================================================== diff -u -r5718 -r5724 --- branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5718) +++ branches/unlabeled/unlabeled-1.155.2/core/kernel/application.php (.../application.php) (revision 5724) @@ -323,15 +323,7 @@ { $language_id = $this->GetVar('m_lang'); if (!$language_id) { - $language_id = $this->GetDefaultLanguageId(); - if (!$language_id) { - if (!$this->Application->IsAdmin()) { - $this->ApplicationDie('No Primary Language Selected'); - } - else { - $language_id = 1; - } - } + $language_id = 'default'; } $this->SetVar('lang.current_id', $language_id ); $this->SetVar('m_lang', $language_id ); @@ -520,6 +512,8 @@ $this->setCache('item_templates', $id, $category_data['CachedItemTemplate']); } else { + + $resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.$table.' WHERE '.$id_field.' = '.$this->Conn->qstr($id)); if (is_null($category_id)) $category_id = $this->GetVar('m_cat_id'); $sql = 'SELECT Filename FROM '.TABLE_PREFIX.'CategoryItems WHERE ItemResourceId = '.$resource_id.' AND CategoryId = '.$category_id; @@ -1409,7 +1403,7 @@ $buffer_content = ob_get_clean(); echo $this->UseOutputCompression() ? gzencode($buffer_content, DBG_COMPRESSION_LEVEL) : $buffer_content; - + $session =& $this->recallObject('Session'); $session->SaveData(); $this->SaveBlocksCache();