diff --git a/library/Class/Catalogue.php b/library/Class/Catalogue.php index 549c2b817b04587cec19da21d630e8be5c89ba64..afe53bb4d2f1b525637e2e3108f608df84d896b6 100644 --- a/library/Class/Catalogue.php +++ b/library/Class/Catalogue.php @@ -382,9 +382,16 @@ class Class_Catalogue extends Storm_Model_Abstract { public function deleteThesaurusInFacette($id_thesaurus) { - $sql = Zend_Registry::get('sql'); - $sql->query('update notices set facettes = clean_spaces(replace(facettes,"H'.$id_thesaurus.'","")) '. - 'where match(facettes) against("+H'.$id_thesaurus.'" in boolean mode)'); + /* + * Sites, articles and RSS records are first destroyed and then get their own selection of domains. + * So therauri facettes must not be deleted. By the way, need to find a nicer implementation ... + */ + $query = + 'update notices set facettes = clean_spaces(replace(facettes,"H'.$id_thesaurus.'","")) '. + 'where type_doc not in ('.implode(',', [Class_TypeDoc::ARTICLE, Class_TypeDoc::RSS, Class_TypeDoc::SITE]).') '. + 'and match(facettes) against("+H'.$id_thesaurus.'" in boolean mode)'; + + Zend_Registry::get('sql')->query($query); }