From 646f23c1bd5b13e7c220e27c123ce667c0301acf Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Wed, 4 Sep 2019 20:56:26 +0300
Subject: [PATCH] Setup followup on user login only if outside lightbox.
 (#1422)

---
 .../VuFind/src/VuFind/Controller/MyResearchController.php   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php
index 3eae2a3fe1a..19d2e2952f4 100644
--- a/module/VuFind/src/VuFind/Controller/MyResearchController.php
+++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php
@@ -322,7 +322,11 @@ class MyResearchController extends AbstractBase
                 : $this->redirect()->toRoute('home');
         }
         $this->clearFollowupUrl();
-        $this->setFollowupUrlToReferer();
+        // Set followup only if we're not in lightbox since it has the short-circuit
+        // for reloading current page:
+        if (!$this->inLightbox()) {
+            $this->setFollowupUrlToReferer();
+        }
         if ($si = $this->getSessionInitiator()) {
             return $this->redirect()->toUrl($si);
         }
-- 
GitLab