From 1a6d8769629be9b3677f57892a2312e6d4e85267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.bernigaud@opensides.be>
Date: Thu, 10 Mar 2016 06:07:54 +0100
Subject: [PATCH] Fixes #4600 The base is lost when changing plugin

---
 include/class_listing.inc                       | 2 +-
 include/simpleplugin/class_simpleManagement.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class_listing.inc b/include/class_listing.inc
index 0e5792829..9d2231a38 100644
--- a/include/class_listing.inc
+++ b/include/class_listing.inc
@@ -1500,7 +1500,7 @@ class listing {
       }
     }
 
-    if (!isset($this->bases[$this->base])) {
+    if (!empty($this->bases) && !isset($this->bases[$this->base])) {
       $this->base = key($this->bases);
     }
 
diff --git a/include/simpleplugin/class_simpleManagement.inc b/include/simpleplugin/class_simpleManagement.inc
index e544e84eb..79e9b83ae 100644
--- a/include/simpleplugin/class_simpleManagement.inc
+++ b/include/simpleplugin/class_simpleManagement.inc
@@ -192,7 +192,7 @@ class simpleManagement extends management
 
     $this->configureHeadpage();
     $this->configureFilter();
-    if ($this->departmentBrowser === FALSE) {
+    if ($this->baseMode === FALSE) {
       $this->headpage->setBase($this->config->current['BASE']);
     }
   }
-- 
GitLab