From 135b69d07233fe1a5b58ceb9ed380b5a07c34c98 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Tue, 28 Jul 2020 09:49:23 +0200
Subject: [PATCH] refs #18066 [master] fix response format of
 GetAdditionalAccountInfo

* "unpacks" AjaxHandler response
* now shows item counts in MyResearch menu correctly
---
 .../src/finc/AjaxHandler/GetAdditionalAccountInfo.php     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/module/finc/src/finc/AjaxHandler/GetAdditionalAccountInfo.php b/module/finc/src/finc/AjaxHandler/GetAdditionalAccountInfo.php
index 96a7ca44639..5d6f7c179ba 100644
--- a/module/finc/src/finc/AjaxHandler/GetAdditionalAccountInfo.php
+++ b/module/finc/src/finc/AjaxHandler/GetAdditionalAccountInfo.php
@@ -61,16 +61,16 @@ class GetAdditionalAccountInfo extends \VuFind\AjaxHandler\AbstractIlsAndUserAct
         try {
             $patron = $this->ilsAuthenticator->storedCatalogLogin();
             if ($patron) {
-                $additionalAccountInfos = [];
-                $additionalAccountInfos['countViewItems'] = $this->ils->countItems(
+                $countViewItems = $this->ils->countItems(
                     $viewsToCount,
                     $patron
                 );
 
-                $additionalAccountInfos['countFines'] = $this->ils->getFinesTotal(
+                $countFines = $this->ils->getFinesTotal(
                     $patron
                 );
-                return $this->formatResponse(compact('additionalAccountInfos'));
+
+                return $this->formatResponse(compact('countViewItems','countFines'));
             }
         } catch (\Exception $e) {
             // Do nothing -- just fail through to the error message below.
-- 
GitLab