From 755066b52577ce08ae577752945380046c3f6d60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org>
Date: Tue, 11 Aug 2020 12:38:00 +0200
Subject: [PATCH] :ambulance: feat(templates) Improve dialog support on
 non-simplePlugin tabs

issue #6106
---
 include/class_template.inc | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/include/class_template.inc b/include/class_template.inc
index f455a5b4a..cf2b0369a 100644
--- a/include/class_template.inc
+++ b/include/class_template.inc
@@ -263,12 +263,20 @@ class template
         continue;
       }
       if ($plugin->is_modal_dialog()) {
-        $dialogResult = $plugin->dialog->execute();
-        if ($dialogResult === FALSE) {
-          $plugin->closeDialog();
+        if ($plugin instanceof simplePlugin) {
+          $dialogResult = $plugin->dialog->execute();
+          if ($dialogResult === FALSE) {
+            $plugin->closeDialog();
+          } else {
+            $this->tabObject->current = $class;
+            return $dialogResult;
+          }
         } else {
-          $this->tabObject->current = $class;
-          return $dialogResult;
+          $dialogResult = $plugin->execute();
+          if ($plugin->is_modal_dialog()) {
+            $this->tabObject->current = $class;
+            return $dialogResult;
+          }
         }
       }
       $attributesRendered = [];
-- 
GitLab