diff --git a/VERSIONS_HOTLINE/general_performances b/VERSIONS_HOTLINE/general_performances
new file mode 100644
index 0000000000000000000000000000000000000000..0fe9f6944cd2e9ecfa84ae15ce7c27daf696b1e4
--- /dev/null
+++ b/VERSIONS_HOTLINE/general_performances
@@ -0,0 +1 @@
+Magasin de thème : Amélioration générale des performances
\ No newline at end of file
diff --git a/library/Class/Article.php b/library/Class/Article.php
index afc750af2698fa7fc184064d6d6073128af2b538..e597970d8594f73814d22f2f57590851bc7cdb54 100644
--- a/library/Class/Article.php
+++ b/library/Class/Article.php
@@ -639,6 +639,7 @@ class Class_Article extends Storm_Model_Abstract {
                                           'id_cat' => 0,
                                           'domaine_ids' => '',
                                           'id_origine' => 0,
+                                          'parent_id' => 0,
                                           'repository_origine' => '',
                                           'refus_message' => '',
                                           'destination_email' => '',
@@ -737,14 +738,14 @@ class Class_Article extends Storm_Model_Abstract {
 
 
   public static function sortByEventDebut($article1, $article2) {
-    if (0 === $evt_cmp = strcmp($article1->getEventsDebut(), $article2->getEventsDebut()))
-      return strcmp($article1->getEventsFin(), $article2->getEventsFin());
+    if (0 === $evt_cmp = strcmp($article1->rawEventsDebut(), $article2->rawEventsDebut()))
+      return strcmp($article1->rawEventsFin(), $article2->rawEventsFin());
     return $evt_cmp;
   }
 
 
   public static function sortByDebutPublicationDesc($article1, $article2) {
-    return strcmp($article2->getDebut(), $article1->getDebut());
+    return strcmp($article2->rawDebut(), $article1->rawDebut());
   }
 
 
@@ -795,6 +796,9 @@ class Class_Article extends Storm_Model_Abstract {
    * @return Class_Article
    */
   public function getTraductionLangue($langue) {
+    if ($langue == $this->getLangue())
+      return $this;
+
     if ($original = $this->getArticleOriginal())
       return $original->getTraductionLangue($langue);
 
@@ -850,7 +854,8 @@ class Class_Article extends Storm_Model_Abstract {
    * @return bool
    */
   public function isTraduction() {
-    return $this->hasArticleOriginal();
+    return (isset($this->_attributes['parent_id']) && $this->_attributes['parent_id']) // for performances
+      && $this->hasArticleOriginal();
   }
 
   /**
@@ -910,6 +915,34 @@ class Class_Article extends Storm_Model_Abstract {
   }
 
 
+  public function rawEventsDebut() {
+    return isset($this->_attributes['events_debut'])
+      ? $this->_attributes['events_debut']
+      : '';
+  }
+
+
+  public function rawEventsFin() {
+    return isset($this->_attributes['events_fin'])
+      ? $this->_attributes['events_fin']
+      : '';
+  }
+
+
+  public function rawDebut() {
+    return isset($this->_attributes['debut'])
+      ? $this->_attributes['debut']
+      : '';
+  }
+
+
+  public function rawFin() {
+    return isset($this->_attributes['fin'])
+      ? $this->_attributes['fin']
+      : '';
+  }
+
+
   public function beforeSave() {
     if ($this->isNew() && !$this->getDateCreation())
       $this->setDateCreation($this->getDateMaj());
@@ -1080,17 +1113,9 @@ class Class_Article extends Storm_Model_Abstract {
    * @return string
    */
   public function getUrl() {
-    $url = ['controller' => 'cms',
+    return ['controller' => 'cms',
             'action' => 'articleview',
             'id' => $this->getId()];
-
-    if(!defined("DEVELOPMENT"))
-      return $url;
-
-    if($profil = $this->getProfil())
-      $url['id_profil'] = $profil->getIdProfil();
-
-    return $url;
   }
 
 
@@ -1550,4 +1575,4 @@ class Class_Article extends Storm_Model_Abstract {
       ? true
       : $this->isVisible();
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/Bib.php b/library/Class/Bib.php
index 8d6adb5a101699518aa44eb98ded1cfa93cf9ab7..49dac9dc7092633e35580c4442389ea7a379acb2 100644
--- a/library/Class/Bib.php
+++ b/library/Class/Bib.php
@@ -449,10 +449,14 @@ class Class_Bib extends Storm_Model_Abstract {
 
 
   protected function _getProfilForUrl() {
-    return $this->hasLinkToProfil()
-      ? $this->getLinkToProfil()
-      // used on obsolete zone / map configuration
-      : Class_Profil::find($this->getAffZoneAsArray()["profilID"]);
+    if ($this->hasLinkToProfil())
+      return $this->getLinkToProfil();
+
+    // used on obsolete zone / map configuration
+    if ($id_profil = (int)$this->getAffZoneAsArray()["profilID"])
+      return Class_Profil::find($id_profil);
+
+    return null;
   }
 
 
diff --git a/library/Class/CodifAnnexe.php b/library/Class/CodifAnnexe.php
index 0acb850fcefa2a34800fdb10f0c15d3a56d3d7aa..032a2a6f55c7f6041b441be50cbdd16a102e4acf 100644
--- a/library/Class/CodifAnnexe.php
+++ b/library/Class/CodifAnnexe.php
@@ -55,13 +55,14 @@ class CodifAnnexeLoader extends Storm_Model_Loader {
 
 
   public function getMultiOptionsFacets() {
-    $multi_options = $this->getMultiOptions();
     $multi_options_facets = [];
-    foreach ($multi_options as $id => $label) {
-      if (!$annexe = Class_CodifAnnexe::find($id))
-        continue;
+    $annexes =  ($annex_ids = array_filter(array_keys($this->getMultiOptions())))
+      ? Class_CodifAnnexe::findAllBy(['id_annexe' => $annex_ids])
+      : [];
+
+    foreach ($annexes as $annexe)
       $multi_options_facets[$annexe->getFacetCode()] = $annexe->getLabel();
-    }
+
     asort($multi_options_facets);
     array_unshift($multi_options_facets, $this->_('tous'));
     return $multi_options_facets;
diff --git a/library/Class/CompareUrl.php b/library/Class/CompareUrl.php
index ec057b7cee5289f201cb32d439afbd5ba1c08c8f..7d340ae8a46918310e82757b00f448264ecb2f9b 100644
--- a/library/Class/CompareUrl.php
+++ b/library/Class/CompareUrl.php
@@ -82,27 +82,33 @@ class Class_CompareUrl {
 
 
   protected function _checkByProfil($url) {
-    return $this->_extractProfileIdFormUrl($url) == Class_Profil::getCurrentProfil()->getId();
-  }
-
-
-  protected function _extractProfileIdFormUrl($url) {
     $url = Class_Url::absolute($url);
     if (false === strpos($url, Class_Url::domain()))
       return null;
 
     if ( ! $url_request = new Zend_Controller_Request_Http($url))
-      return null;
+      return false;
 
-    $router = $this->_getRouter();
-    $router->route($url_request);
+    $this->_getRouter()->route($url_request);
 
-    $detector = $this->_getDetector();
+    $current_profile = Class_Profil::getCurrentProfil();
+    if ((int)$url_request->getParam('id_profil', $current_profile->getId()) !== $current_profile->getId())
+      return false;
 
-    if ( ! $profil = $detector->detectFrom($url_request))
-      return null;
+    if ([$url_request->getModuleName(), $url_request->getControllerName()] == ['opac', 'index'])
+      return true;
+
+    $current_profile_url = array_merge(['module' => 'opac',
+                                        'controller' => 'index'],
+                                       $current_profile->getUrlParts());
+
+    if ($url_request->getControllerName() == $current_profile_url['module'])
+      return true;
+
+    if ($url_request->getModuleName() !== $current_profile_url['module'])
+      return false;
 
-    return $profil->getId();
+    return $url_request->getControllerName() == $current_profile_url['controller'];
   }
 
 
diff --git a/library/Class/CustomField.php b/library/Class/CustomField.php
index 5a55fdaf67b84f1e204a7312ec22c99eb10f7273..d39e2ea31d00706bff11e8e8877d42f2adc5b9f4 100644
--- a/library/Class/CustomField.php
+++ b/library/Class/CustomField.php
@@ -20,6 +20,19 @@
  */
 
 class CustomFieldsLoader extends Storm_Model_Loader {
+  protected $_fields_by_model = [];
+
+
+  public function findAllByModel($custom_field_model) {
+    $cfm_id = $custom_field_model->getId();
+    if (isset($this->_fields_by_model[$cfm_id]))
+      return $this->_fields_by_model[$cfm_id];
+
+    return $this->_fields_by_model[$cfm_id] = Class_CustomField::findAllBy(['model' => $cfm_id,
+                                                                            'order' => 'priority']);
+  }
+
+
   public function getAvailableMeta($model) {
     $availables_meta = [];
     $custom_fields_meta = Class_CustomField_Meta::findAll();
@@ -190,4 +203,4 @@ class Class_CustomField extends Storm_Model_Abstract {
   public function getThesaurusIdOrigine() {
     return $this->getMeta()->getId();
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/CustomField/Model.php b/library/Class/CustomField/Model.php
index 6e8fe003e466c11083d535e486fc9108a367a3a3..71744c41b8d930eb053e3590875e18c9674bb43c 100644
--- a/library/Class/CustomField/Model.php
+++ b/library/Class/CustomField/Model.php
@@ -26,7 +26,10 @@ class Class_CustomField_Model {
 
   protected static $_models = [];
 
-  protected $_configuration, $_mapping;
+  protected
+    $_configuration,
+    $_mapping,
+    $_badgeable_fields;
 
   public static function registerAll($array_of_models_configuration) {
     static::$_models = [];
@@ -131,12 +134,14 @@ class Class_CustomField_Model {
 
 
   public function getFields() {
-    return Class_CustomField::findAllBy(['model' => $this->getId(),
-                                         'order' => 'priority']);
+    return Class_CustomField::findAllByModel($this);
   }
 
 
   public function getBadgeableFields() {
+    if (isset($this->_badgeable_fields))
+      return $this->_badgeable_fields;
+
     $meta_ids =
       (new Storm_Model_Collection(Class_CustomField_Meta::findAllBy(['field_type' => [Class_CustomField_Meta::MULTI_CHECKBOX,
                                                                                       Class_CustomField_Meta::SELECT,
@@ -145,11 +150,11 @@ class Class_CustomField_Model {
       ->getArrayCopy();
 
     if (empty($meta_ids))
-      return [];
+      return $this->_badgeable_fields = [];
 
-    return Class_CustomField::findAllBy(['model' => $this->getId(),
-                                         'order' => 'priority',
-                                         'meta_id' => $meta_ids]);
+    return $this->_badgeable_fields = Class_CustomField::findAllBy(['model' => $this->getId(),
+                                                                    'order' => 'priority',
+                                                                    'meta_id' => $meta_ids]);
   }
 
 
@@ -255,4 +260,4 @@ class Class_CustomField_NullModel extends Class_CustomField_Model {
     return new Class_CustomField_NullModelValues();
   }
 }
-?>
\ No newline at end of file
+?>
diff --git a/library/Class/CustomField/ModelValues.php b/library/Class/CustomField/ModelValues.php
index 3e515d3de8cc31598a23617a584b028cfb800aaa..4aab64cd1991c197bf01ab75f6e01545c158115d 100644
--- a/library/Class/CustomField/ModelValues.php
+++ b/library/Class/CustomField/ModelValues.php
@@ -95,10 +95,15 @@ class Class_CustomField_ModelValues {
     $fields = $callback();
     $model_id = $this->_customized_model->getId();
 
+    $all_values = Class_CustomField_Value::findAllByInstanceIndexedById($this->_customized_model);
+
     $values = [];
     foreach($fields as $field) {
       $custom_field_id = $field->getId();
-      $values[$custom_field_id] = Class_CustomField_Value::findOrCreate($model_id, $custom_field_id);
+      $values[$custom_field_id] = isset($all_values[$custom_field_id])
+        ? $all_values[$custom_field_id]
+        : Class_CustomField_Value::newInstance(['model_id' => $model_id,
+                                                'custom_field_id' => $custom_field_id]);
     }
 
     return $this->_values = $values;
@@ -130,4 +135,4 @@ class Class_CustomField_ModelValues {
     return $this;
   }
 }
-?>
\ No newline at end of file
+?>
diff --git a/library/Class/CustomField/Value.php b/library/Class/CustomField/Value.php
index 45ac2e6734960c92d37f9c44195eccc7d17111d8..7ee9a5710314f9a09af6b542886f53951d8ff8cf 100644
--- a/library/Class/CustomField/Value.php
+++ b/library/Class/CustomField/Value.php
@@ -43,6 +43,15 @@ class Class_CustomField_ValueLoader extends Storm_Model_Loader {
     return Class_CustomField_Value::findAllBy(['model_id' => $instance->getId(),
                                                'custom_field_id' => $field_ids]);
   }
+
+
+  public function findAllByInstanceIndexedById($instance) {
+    $values = $this->findAllByInstance($instance);
+    $by_id = [];
+    foreach($values as $value)
+      $by_id[$value->getCustomFieldId()] = $value;
+    return $by_id;
+  }
 }
 
 
diff --git a/library/Class/DigitalResource.php b/library/Class/DigitalResource.php
index 865f169d3a4eacee0af39ce276da25a0d2b4e6e4..af4bfad3897d0240e92e3af927f52dbd562b22b3 100644
--- a/library/Class/DigitalResource.php
+++ b/library/Class/DigitalResource.php
@@ -468,4 +468,4 @@ class Class_DigitalResource_ConfigProvider {
       return null;
     return new $class_name(new Class_DigitalResource_Wrapper($digital_resource, $plugin));
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/DigitalResource/Config.php b/library/Class/DigitalResource/Config.php
index ef4b8cccfc96a037e1928bd77e8adb2f46de284c..b0daba9c616afa8282ed762c92357449a63a9484 100644
--- a/library/Class/DigitalResource/Config.php
+++ b/library/Class/DigitalResource/Config.php
@@ -26,7 +26,8 @@ class Class_DigitalResource_Config extends Class_Entity {
     HARVEST = 'HARVEST',
     SSO = 'SSO';
 
-  protected $_name,
+  protected
+    $_name,
     $_digital_resource,
     $_admin_var_cache = [];
 
@@ -52,7 +53,6 @@ class Class_DigitalResource_Config extends Class_Entity {
     $this->_name = static::getNameFor(static::class);
     $this->setDigitalResource($digital_resource);
     $this->updateAttributes(array_merge($this->_getDefaultConfig(), $this->_getConfig()));
-    $this->_ensurePermission();
   }
 
 
@@ -140,17 +140,7 @@ class Class_DigitalResource_Config extends Class_Entity {
 
 
   public function getPermission() {
-    return Class_Permission::findFirstBy(['code' => static::getName()]);
-  }
-
-
-  protected function _ensurePermission() {
-    if ($this->getPermission())
-      return $this;
-
-    $permission = Class_Permission::newInstance(['code' => static::getName()]);
-    $permission->save();
-    return $this;
+    return Class_Permission::findOrCreateByCode(static::getName());
   }
 
 
@@ -364,7 +354,7 @@ class Class_DigitalResource_Config extends Class_Entity {
 
     $group->save();
 
-    if(!$permission = Class_Permission::findFirstBy(['code' => $this->getName()]))
+    if (!$permission = $this->getPermission())
        return $group;
 
     $permission->permitTo($group, new Class_Entity());
@@ -433,4 +423,4 @@ class Class_DigitalResource_Config extends Class_Entity {
   public function renderTrySsoUrlOn($view, $params=[]) {
     return $view->url(array_merge($params, ['action' => 'try-sso']));
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/Notice.php b/library/Class/Notice.php
index 23d6a59ffc83f0b3fd281a6091a4aa0509e14985..526a81eca2314d7f9d2f7935fc91beaa1c6f1545 100644
--- a/library/Class/Notice.php
+++ b/library/Class/Notice.php
@@ -316,12 +316,15 @@ class Class_Notice extends Storm_Model_Abstract {
     if (!$this->isRessourceNumerique())
       return null;
 
-    if(!$first_exemplaire = $this->getFirstExemplaire())
+    if (!$first_exemplaire = $this->getFirstExemplaire())
       return null;
 
-    return ($album = Class_Album::find($first_exemplaire->getIdOrigine()))
+    if (!$album_id = $first_exemplaire->getIdOrigine())
+      return null;
+
+    return ($album = Class_Album::find($album_id))
       ? $album
-      : Class_Album::findFirstBy(['id_origine' => $first_exemplaire->getIdOrigine()]);
+      : Class_Album::findFirstBy(['id_origine' => $album_id]);
   }
 
 
diff --git a/library/Class/Permission.php b/library/Class/Permission.php
index b1114551844b269cdebbe6cbf923b18b0d6d07c6..4fe39868288e78b3d70c8ab38293545c79319881 100644
--- a/library/Class/Permission.php
+++ b/library/Class/Permission.php
@@ -27,7 +27,26 @@ class PermissionLoader extends Storm_Model_Loader {
   protected
     $_article,
     $_article_category,
-    $_cms;
+    $_cms,
+    $_permissions_by_code;
+
+
+  public function findOrCreateByCode($code) {
+    if (!isset($this->_permissions_by_code)) {
+      $this->_permissions_by_code = [];
+      foreach(Class_Permission::findAll() as $permission)
+        $this->_permissions_by_code[$permission->getCode()] = $permission;
+    }
+
+    if (!isset($this->_permissions_by_code[$code])) {
+      $permission = Class_Permission::newInstance(['code' => $code]);
+      $permission->save();
+
+      $this->_permissions_by_code[$code] = $permission;
+    }
+
+    return $this->_permissions_by_code[$code];
+  }
 
 
   public function getCmsPermissions() {
@@ -158,4 +177,4 @@ class Class_Permission extends Storm_Model_Abstract {
 
     return $users;
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/Template.php b/library/Class/Template.php
index ea54e355a994b71a0f07bc0611a5cb21e649ed0f..ff81c6a37e1ebc5bd8bef3bdb64bf78d9a0a8303 100644
--- a/library/Class/Template.php
+++ b/library/Class/Template.php
@@ -454,7 +454,13 @@ class Class_Template {
   public function getSettings() {
     return $this->_settings
       ? $this->_settings
-      : $this->_settings = Class_Template_Settings::newInstance();
+      : $this->_settings = $this->_buildSettings();
+  }
+
+
+  protected function _buildSettings() {
+    $class_name = explode('_', get_class($this))[0] . '_Library_Settings';
+    return new $class_name($this);
   }
 
 
@@ -646,4 +652,4 @@ class Class_Template {
   public function getRedirectActionFor($action) {
     return $action;
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/Template/Loader.php b/library/Class/Template/Loader.php
index 97c8f22d49a7a4d71e00a54d02cd2e2dc044b578..b3ea2cc5a09276bc523535b20c50e8a0c855ee38 100644
--- a/library/Class/Template/Loader.php
+++ b/library/Class/Template/Loader.php
@@ -23,7 +23,6 @@
 class Class_Template_Loader {
   use Trait_Translator;
 
-
   public function getTemplates() {
     return [new Chili_Template,
             new Historic_Template,
@@ -31,8 +30,7 @@ class Class_Template_Loader {
             new Muscle_Template,
             new MyBibApp_Template,
             new Polygone_Template,
-            new TerreDuMilieu_Template,
-    ];
+            new TerreDuMilieu_Template];
   }
 
 
@@ -76,4 +74,4 @@ class Class_Template_Loader {
     return (new Historic_Template)
       ->setProfile(Class_Profil::getRoot());
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/Template/Settings.php b/library/Class/Template/Settings.php
index 132aa7b0dca4df3179983c5a571fe7b42e3187cb..a959a0317b05ade194fbcb032d0b7d78fa18fd3b 100644
--- a/library/Class/Template/Settings.php
+++ b/library/Class/Template/Settings.php
@@ -86,18 +86,19 @@ class Class_Template_Settings extends Storm_Model_Abstract {
   }
 
 
-  protected function _updateSettings($data) {
-    if(!isset($data['settings']))
-      return serialize($data);
+  protected function _getSettingsInDb() {
+    return isset($this->_attributes_in_db['settings'])
+      ? unserialize($this->_attributes_in_db['settings'])
+      : [];
+  }
 
-    $old_settings = unserialize($data['settings']);
-    unset($data['settings']);
 
-    $new_data = $old_settings
-      ? array_merge($old_settings, $data)
+  protected function _updateSettings($data) {
+    $new_settings = isset($data['settings'])
+      ? unserialize($data['settings'])
       : $data;
 
-    return serialize($new_data);
+    return serialize(array_merge($this->_getSettingsInDb(), $new_settings));
   }
 
 
@@ -137,4 +138,4 @@ class Class_Template_Settings extends Storm_Model_Abstract {
 
     return $this;
   }
-}
\ No newline at end of file
+}
diff --git a/library/Class/WebService/BibNumerique/ArteVOD/Config.php b/library/Class/WebService/BibNumerique/ArteVOD/Config.php
index 6c13f4ed757bb262d64b5655b07ef250cac40ce1..2cbbd9b390bc04fa195a8140f25b439249daf988 100644
--- a/library/Class/WebService/BibNumerique/ArteVOD/Config.php
+++ b/library/Class/WebService/BibNumerique/ArteVOD/Config.php
@@ -126,7 +126,7 @@ class Class_WebService_BibNumerique_ArteVOD_Config extends Class_Entity {
 
     $group->save();
 
-    if(!$permission = Class_Permission::findFirstBy(['code' => $this->getName()]))
+    if (!$permission = Class_Permission::findOrCreateByCode($this->getName()))
        return $group;
 
     $permission->permitTo($group, new Class_Entity());
@@ -201,4 +201,4 @@ class Class_WebService_BibNumerique_ArteVOD_Config extends Class_Entity {
   public function renderTrySsoUrlOn($view, $params=[]) {
     return $view->url(array_merge($params, ['action' => 'artevod-try-sso']));
   }
-}
\ No newline at end of file
+}
diff --git a/library/ZendAfi/Form/Admin/Sitotheque.php b/library/ZendAfi/Form/Admin/Sitotheque.php
index 2fe78ea719a7923badaff8cfa3eb697adba16cdf..1f8801dfc374b3ab768cfed0f0c3d12cb8d7e3b2 100644
--- a/library/ZendAfi/Form/Admin/Sitotheque.php
+++ b/library/ZendAfi/Form/Admin/Sitotheque.php
@@ -70,12 +70,11 @@ class ZendAfi_Form_Admin_Sitotheque extends ZendAfi_Form {
 
   }
 
+
   protected function addDomainIndexation() {
-    if (defined('DEVELOPMENT'))
-      return $this->addElement('domainSelect', 'domaine_ids')
-                  ->addDisplayGroup(['domaine_ids'], 'domains_set', ['legend' => $this->_('Indexation')]);
+    return $this->addElement('domainSelect', 'domaine_ids')
+                ->addDisplayGroup(['domaine_ids'], 'domains_set', ['legend' => $this->_('Indexation')]);
 
-    return $this;
   }
 }
 ?>
diff --git a/library/digital_resources/Lekiosk/tests/LekioskTest.php b/library/digital_resources/Lekiosk/tests/LekioskTest.php
index b8faf74cad06815cc0e53dbb8ec84954848b4c02..a1bebcdbfa684ed795e6cf342f26c4b9aa26c87b 100644
--- a/library/digital_resources/Lekiosk/tests/LekioskTest.php
+++ b/library/digital_resources/Lekiosk/tests/LekioskTest.php
@@ -130,8 +130,7 @@ class LekioskModulesControllerUserWithGroupWithRightTest
     $group = $this->fixture('Class_UserGroup',
                             ['id' => 1]);
 
-    Lekiosk_Config::getInstance()->getPermissions();
-    $lekiosk_permission_id = Class_Permission::findFirstBy(['code' => 'Lekiosk'])->getId();
+    $lekiosk_permission_id = Lekiosk_Config::getInstance()->getPermission()->getId();
 
     $this->fixture('Class_UserGroup_Permission',
                    ['id' => 1,
@@ -387,8 +386,7 @@ class LekioskRenderAlbumFromRecordTest extends LekioskServiceTestCase {
     $group = $this->fixture('Class_UserGroup',
                             ['id' => 1]);
 
-    Lekiosk_Config::getInstance()->getPermissions();
-    $lekiosk_permission_id = Class_Permission::findFirstBy(['code' => 'Lekiosk'])->getId();
+    $lekiosk_permission_id = Lekiosk_Config::getInstance()->getPermission()->getId();
 
     $this->fixture('Class_UserGroup_Permission',
                    ['id' => 1,
@@ -663,8 +661,7 @@ class LekioskServiceHttpHarvestingNoticeAjaxTest extends LekioskServiceHttpHarve
     $group = $this->fixture('Class_UserGroup',
                             ['id' => 1]);
 
-    Lekiosk_Config::getInstance()->getPermissions();
-    $lekiosk_permission_id = Class_Permission::findFirstBy(['code' => 'Lekiosk'])->getId();
+    $lekiosk_permission_id = Lekiosk_Config::getInstance()->getPermission()->getId();
 
     $this->fixture('Class_UserGroup_Permission',
                    ['id' => 1,
@@ -779,4 +776,4 @@ class LekioskPluginTest extends Admin_AbstractControllerTestCase {
   public function noTokenErrorMessageShouldBePresent() {
     $this->assertXPathContentContains('//div', 'La réponse reçue ne permet pas de récupérer le "token". Il est donc impossible de récupérer le catalogue. Veuillez vérifier les variables liées au moissonnage. Si le problème persiste, contacter le prestataire en lui fournissant le paramétrage ainsi que le rapport du diagnostique de moissonnage.');
   }
-}
\ No newline at end of file
+}
diff --git a/library/digital_resources/Skilleos/tests/SkilleosTest.php b/library/digital_resources/Skilleos/tests/SkilleosTest.php
index 5ecc6de6552eac9415a85b1260a07fb0efb8f9a6..a8babf521242f11106a7675ceb2171adecda6646 100644
--- a/library/digital_resources/Skilleos/tests/SkilleosTest.php
+++ b/library/digital_resources/Skilleos/tests/SkilleosTest.php
@@ -54,8 +54,7 @@ class SkilleosModulesControllerUserWithGroupWithRightTest
     $group = $this->fixture('Class_UserGroup',
                             ['id' => 1]);
 
-    Skilleos_Config::getInstance()->getPermissions();
-    $skilleos_permission_id = Class_Permission::findFirstBy(['code' => 'Skilleos'])->getId();
+    $skilleos_permission_id = Skilleos_Config::getInstance()->getPermission()->getId();
 
     $this->fixture('Class_UserGroup_Permission',
                    ['id' => 1,
@@ -460,6 +459,7 @@ class SkilleosDashboardTrySsoTest extends SkilleosServiceTestCase {
                             'password' => 'super',
                             'role_level' => ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN]);
 
+
     ZendAfi_Auth::getInstance()->logUser($user);
     $this->dispatch('/Skilleos_Plugin/index/try-sso', true);
   }
@@ -469,4 +469,4 @@ class SkilleosDashboardTrySsoTest extends SkilleosServiceTestCase {
   public function shouldJavascriptRedirectToMoncompteDotSkilleos() {
     $this->assertXPathContentContains('//script', 'document.location.href="https://moncompte.skilleos.com/sign/cas?casid=QUEST&ticket');
   }
-}
\ No newline at end of file
+}
diff --git a/library/templates/Chili/Template.php b/library/templates/Chili/Template.php
index 48203652bb8087644d1aa5c1f0237a3f2cc9cae2..40c2a81b3f67e6dcb1f2a52f29d38cb4c7c4ec89 100644
--- a/library/templates/Chili/Template.php
+++ b/library/templates/Chili/Template.php
@@ -28,7 +28,6 @@ class Chili_Template extends Intonation_Template {
   public function __construct() {
     $this->setId(static::ID)
          ->setTitle($this->_('Chili (en cours de développement)'))
-         ->setSettings(new Chili_Library_Settings($this))
          ->setPatcher(new Chili_Library_ProfilePatcher($this));
   }
 
@@ -139,4 +138,4 @@ class Chili_Template extends Intonation_Template {
   public function renderOpac($view) {
     return (new Chili_View_Opac($this, $view))->render();
   }
-}
\ No newline at end of file
+}
diff --git a/library/templates/Historic/Template.php b/library/templates/Historic/Template.php
index 3a483df854c9f8f2fe451b84f820935385e9b5cd..3092408eafd0c660ab56748c52a0adbbeeeeb50d 100644
--- a/library/templates/Historic/Template.php
+++ b/library/templates/Historic/Template.php
@@ -28,6 +28,11 @@ class Historic_Template extends Class_Template {
   }
 
 
+  protected function _buildSettings() {
+    return Class_Template_Settings::newInstance();
+  }
+
+
   public function renderOpac($view) {
     ob_start();
     echo '<body '.$view->bodyParam.'>';
@@ -134,4 +139,4 @@ class Historic_Template extends Class_Template {
       ? 'activities-registered'
       : parent::getRedirectActionFor($action);
   }
-}
\ No newline at end of file
+}
diff --git a/library/templates/Intonation/Template.php b/library/templates/Intonation/Template.php
index 830708aa132610da97e0c8a730995bc9298dcca4..bfad9299e4124a41826dacde63ea2443a5459e79 100644
--- a/library/templates/Intonation/Template.php
+++ b/library/templates/Intonation/Template.php
@@ -33,7 +33,6 @@ class Intonation_Template extends Class_Template {
     $this
       ->setId(static::ID)
       ->setTitle($this->_('Intonation'))
-      ->setSettings(new Intonation_Library_Settings($this))
       ->setPatcher(new Intonation_Library_ProfilePatcher($this));
   }
 
diff --git a/library/templates/Muscle/Template.php b/library/templates/Muscle/Template.php
index ec45084a16a1045ea9ede177ef98897f42990e54..fc0f7140a8d789a26158d60acfd04512b6c06ed9 100644
--- a/library/templates/Muscle/Template.php
+++ b/library/templates/Muscle/Template.php
@@ -28,7 +28,6 @@ class Muscle_Template extends Intonation_Template {
   public function __construct() {
     $this->setId(static::ID)
          ->setTitle($this->_('Musclé'))
-         ->setSettings(new Muscle_Library_Settings($this))
          ->setPatcher(new Muscle_Library_ProfilePatcher($this));
   }
 
diff --git a/library/templates/MyBibApp/Template.php b/library/templates/MyBibApp/Template.php
index f73cab436a7055599bbca84e2cf7a21f416aaeda..d1fb0b2bb6d4414e8d35313c002c477bf4f5fca2 100644
--- a/library/templates/MyBibApp/Template.php
+++ b/library/templates/MyBibApp/Template.php
@@ -26,7 +26,6 @@ class MyBibApp_Template extends Intonation_Template {
   public function __construct() {
     $this->setId(static::ID)
          ->setTitle($this->_('MyBibApp'))
-         ->setSettings(new MyBibApp_Library_Settings($this))
          ->setPatcher(new MyBibApp_Library_ProfilePatcher($this));
   }
 
diff --git a/library/templates/Polygone/Template.php b/library/templates/Polygone/Template.php
index 692422adbb796a955e6ee7ed133813b82f2de628..cc3f560c5d2b8b01492678002795d8d4e34f5096 100644
--- a/library/templates/Polygone/Template.php
+++ b/library/templates/Polygone/Template.php
@@ -28,7 +28,6 @@ class Polygone_Template extends Intonation_Template {
   public function __construct() {
     $this->setId(static::ID)
          ->setTitle($this->_('Polygone'))
-         ->setSettings(new Polygone_Library_Settings($this))
          ->setPatcher(new Polygone_Library_ProfilePatcher($this));
   }
 
diff --git a/library/templates/TerreDuMilieu/Template.php b/library/templates/TerreDuMilieu/Template.php
index 3e37f489b3a536d60b957db82f063ca09fb9b82c..afbee5d90d3c9cfd10417217561e64542b71efd7 100644
--- a/library/templates/TerreDuMilieu/Template.php
+++ b/library/templates/TerreDuMilieu/Template.php
@@ -28,7 +28,6 @@ class TerreDuMilieu_Template extends Intonation_Template {
   public function __construct() {
     $this->setId(static::ID)
          ->setTitle($this->_('TerreDuMilieu'))
-         ->setSettings(new TerreDuMilieu_Library_Settings($this))
          ->setPatcher(new TerreDuMilieu_Library_ProfilePatcher($this));
   }
 
diff --git a/tests/application/modules/admin/controllers/ModoControllerTest.php b/tests/application/modules/admin/controllers/ModoControllerTest.php
index b64e66d076b983db23253f79fdfdf45269eff1e3..2054930c0d8e7c971b8924856c62d9d554a17dd0 100644
--- a/tests/application/modules/admin/controllers/ModoControllerTest.php
+++ b/tests/application/modules/admin/controllers/ModoControllerTest.php
@@ -768,6 +768,7 @@ class ModoControllerAvisNoticeHTTPErrorOnGetVignetteTest extends Admin_AbstractC
     $this->fixture('Class_Exemplaire',
                    ['id'=> 10,
                     'id_notice'=> 10,
+                    'id_origine' => 42,
                     'type' => Class_TypeDoc::ARTEVOD]);
 
     $this->fixture('Class_Album',
diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php
index 46e4d7d27c7790d14c44b2e240027b66ed2b51ba..c638d4d98996c38f00d61a06c8fba616b2d3524e 100644
--- a/tests/application/modules/opac/controllers/AuthControllerTest.php
+++ b/tests/application/modules/opac/controllers/AuthControllerTest.php
@@ -1022,8 +1022,7 @@ abstract class AuthControllerPostSimpleSuccessfulTestCase extends AuthController
                             ['id' => 20,
                              'libelle' => 'Multimedia']);
 
-    Musicme_Config::getInstance()->getPermissions();
-    $permission_id = Class_Permission::findFirstBy(['code' => 'Musicme'])->getId();
+    $permission_id = Musicme_Config::getInstance()->getPermission()->getId();
 
     $this->fixture('Class_UserGroup_Permission',
                    ['id' => 1,
@@ -2851,4 +2850,4 @@ class AuthControllerFooBarConnectionTest extends AbstractControllerTestCase {
     $this->assertEquals('2020-06-06 14:14:14',
                         Class_Users::getIdentity()->getLastLogin());
   }
-}
\ No newline at end of file
+}
diff --git a/tests/library/Class/ArticleTest.php b/tests/library/Class/ArticleTest.php
index 5e68480ba555d917daa4af7c70b6404fe36847e8..40a0f8ce2113b59b4f8111307aa589dbc504af7c 100644
--- a/tests/library/Class/ArticleTest.php
+++ b/tests/library/Class/ArticleTest.php
@@ -403,40 +403,6 @@ class ArticleTestSmallArticle extends ModelTestCase {
   }
 
 
-  /** @test **/
-  public function urlProfilShouldContainProfilAdulte() {
-    $profil_adulte=Class_Profil::newInstanceWithId(1,['libelle' => 'Adulte']);
-
-    $cat = Class_ArticleCategorie::newInstanceWithid(32,
-                                                     ['libelle' => 'Adulte',
-                                                      'id_cat_mere' => null,
-                                                      'sous_categorie' => [],
-                                                      'bib' =>  Class_Bib::newInstanceWithId(21, ['libelle' => 'Annecy'])]);
-
-    $this->_article->setCategorie($cat);
-
-    Storm_Test_ObjectWrapper::onLoaderOfModel('Class_ArticleCategorie')
-      ->whenCalled('findAllBy')
-      ->answers([$cat])
-
-      ->whenCalled('findFirstBy')
-      ->answers($cat);
-
-    Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Profil')
-      ->whenCalled('findFirstBy')
-      ->answers($profil_adulte)
-
-      ->whenCalled('findByPath')
-      ->answers($profil_adulte);
-
-    $this->assertEquals(['controller' => 'cms',
-                         'action' => 'articleview',
-                         'id' => '0',
-                         'id_profil' => '1'],
-                        $this->_article->getUrl());
-  }
-
-
   /** @test **/
   public function urlProfilShoulNotContainProfil() {
     $this->assertEquals(['controller' => 'cms',
diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php
index 59730317d811c5777e6c882df9036e7cd69d5f65..a8fa68f82e911820377480d29d2ed2128a32b0bb 100644
--- a/tests/scenarios/Templates/TemplatesTest.php
+++ b/tests/scenarios/Templates/TemplatesTest.php
@@ -865,7 +865,8 @@ class TemplatesPostEditTest extends TemplatesEnabledTestCase {
 
   /** @test */
   public function intonationCoreCssShouldHaveBeenSavedTo1() {
-    $this->assertEquals('1', Class_Template_Settings::findFirstBy(['template' => 'INTONATION'])->getSettingsInstance()->getIntonationCoreCss());
+    $this->assertEquals('1',
+                        Class_Template_Settings::findFirstBy(['template' => 'INTONATION'])->getSettingsInstance()->getIntonationCoreCss());
   }