From 0d585fe6ad5c72f77d6f306049d43c9d043dd058 Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@afi-sa.fr>
Date: Mon, 10 Aug 2015 17:51:11 +0200
Subject: [PATCH] hotline #13566 : viewcritics should display 50 if number
 display set to null or empty

---
 application/modules/opac/controllers/BlogController.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/application/modules/opac/controllers/BlogController.php b/application/modules/opac/controllers/BlogController.php
index 27a13c20daf..326588888d6 100644
--- a/application/modules/opac/controllers/BlogController.php
+++ b/application/modules/opac/controllers/BlogController.php
@@ -90,6 +90,13 @@ class BlogController extends ZendAfi_Controller_Action {
   }
 
 
+	protected function updateBlogConfigDefault() {
+		if (!$this->view->config['nb_display'] || $this->view->config['nb_display']<1) {
+			$this->view->config['nb_display']=(new Class_Systeme_ModulesAppli())->getValeursParDefaut('blog', 'viewcritiques')['nb_display'];
+		}
+	}
+
+
   public function viewcritiquesAction() {
     $this->view->page = $this->_getParam('page',1);
     $id_module = (int)$this->_getParam('id_module');
@@ -97,7 +104,7 @@ class BlogController extends ZendAfi_Controller_Action {
     $preferences =  $profil
       ->getModuleAccueilPreferences($id_module, 'CRITIQUES');
     $this->view->config=$profil->getConfigurationOf('blog','viewcritiques','');
-
+		$this->updateBlogConfigDefault();
     $avis = Class_AvisNotice::getAvisFromPreferences($preferences,[$this->view->page, $this->view->config['nb_display']]);
 
     $this->view->liste_avis = $avis;
-- 
GitLab