Index: branches/RC/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r10516 -r10532 --- branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10516) +++ branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10532) @@ -867,14 +867,20 @@ */ function saveToSearchLog($keywords, $search_type = 0) { - $sql = 'UPDATE '.TABLE_PREFIX.'SearchLog - SET Indices = Indices + 1 - WHERE Keyword = '.$this->Conn->qstr($keywords).' AND SearchType = '.$search_type; // 0 - simple search, 1 - advanced search - $this->Conn->Query($sql); - if ($this->Conn->getAffectedRows() == 0) { - $fields_hash = Array('Keyword' => $keywords, 'Indices' => 1, 'SearchType' => $search_type); - $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SearchLog'); - } + // don't save keywords for each module separately, just one time + // static variable can't help here, because each module uses it's own class instance ! + if (!$this->Application->GetVar('search_logged')) { + $sql = 'UPDATE '.TABLE_PREFIX.'SearchLog + SET Indices = Indices + 1 + WHERE Keyword = '.$this->Conn->qstr($keywords).' AND SearchType = '.$search_type; // 0 - simple search, 1 - advanced search + $this->Conn->Query($sql); + if ($this->Conn->getAffectedRows() == 0) { + $fields_hash = Array('Keyword' => $keywords, 'Indices' => 1, 'SearchType' => $search_type); + $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'SearchLog'); + } + + $this->Application->SetVar('search_logged', 1); + } } /**