Index: kernel/languages/phrases_cache.php =================================================================== --- kernel/languages/phrases_cache.php (revision 12690) +++ kernel/languages/phrases_cache.php (working copy) @@ -149,10 +149,10 @@ return; } - $sql = 'SELECT Translation, UPPER(Phrase) AS Phrase + $sql = 'SELECT Translation, PhraseKey FROM ' . TABLE_PREFIX . 'Phrase WHERE (LanguageId = ' . $this->LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')'; - $this->Phrases = $this->Conn->GetCol($sql, 'Phrase'); + $this->Phrases = $this->Conn->GetCol($sql, 'PhraseKey'); /*foreach($phrases as $phrase => $tanslation) { @@ -242,7 +242,13 @@ function LoadPhraseByLabel($label, $original_label, $allow_editing = true) { - // bug: MySQL don't use index on Phrase column, when function is used on it's value (e.g. UPPER, like in this case) + if (!$allow_editing && !array_key_exists($label, $this->_missingPhrases) && array_key_exists($label, $this->Phrases)) { + // label is aready translated, but it's version without on the fly translation code is requested + $this->Phrases['NE:' . $label] = $this->Phrases[$label]; + + return true; + } + $sql = 'SELECT PhraseId, Translation FROM ' . TABLE_PREFIX . 'Phrase WHERE (LanguageId = ' . $this->LanguageId . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')'; Index: units/categories/categories_event_handler.php =================================================================== --- units/categories/categories_event_handler.php (revision 12690) +++ units/categories/categories_event_handler.php (working copy) @@ -1897,6 +1897,10 @@ { parent::OnListBuild($event); + if (!$this->Application->IsAdmin()) { + return ; + } + $priority_helper =& $this->Application->recallObject('PriorityHelper'); /* @var $priority_helper kPriorityHelper */