From 406f81ac4439962d1a199b476a9bbe4524a7b42c Mon Sep 17 00:00:00 2001
From: Frank Morgner <morgnerf@ub.uni-leipzig.de>
Date: Wed, 18 Apr 2018 11:23:47 +0200
Subject: [PATCH] refs #12988 * fixes serviceLocator changes vf4 for
 finc/Controller/CustomTrait/EmailHoldtrait.php * fixes Email-Hold-Links *
 bugfix in route configuration * @todo check side-effects on other link types
 (refs #11810)

---
 module/finc/config/module.config.php                         | 2 +-
 .../finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php | 5 ++---
 module/finc/src/finc/ILS/Logic/Holds.php                     | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php
index c470eba965c..1b38c9f91a7 100644
--- a/module/finc/config/module.config.php
+++ b/module/finc/config/module.config.php
@@ -158,7 +158,7 @@ $config = [
 ];
 
 $nonTabRecordActions = [
-    'PDA', 'EmailHold', 'EmailHoldLink', 'ReportErrors'
+    'PDA', 'EmailHold', 'ReportErrors'
 ];
 
 
diff --git a/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php b/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php
index e6fbbf5a097..0b9688e919a 100644
--- a/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php
+++ b/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php
@@ -170,8 +170,7 @@ trait EmailHoldTrait
                 $to = new Address($emailProfile->to);
                 // Get mailer
                 $mailer = new Mailer(
-                    $this->getServiceLocator()
-                        ->get('VuFind\Mailer')->getTransport()
+                    $this->serviceLocator->get('VuFind\Mailer')->getTransport()
                 );
 
                 $mailer->sendTextHtml(
@@ -195,7 +194,7 @@ trait EmailHoldTrait
         // Find and format the default required date:
         $defaultRequired = $this->emailHold()
             ->getDefaultRequiredDate($checkRequests);
-        $defaultRequired = $this->getServiceLocator()->get('VuFind\DateConverter')
+        $defaultRequired = $this->serviceLocator->get('VuFind\DateConverter')
             ->convertToDisplayDate("U", $defaultRequired);
         try {
             $defaultPickup
diff --git a/module/finc/src/finc/ILS/Logic/Holds.php b/module/finc/src/finc/ILS/Logic/Holds.php
index c7f5a366f2c..a81b6a21a87 100644
--- a/module/finc/src/finc/ILS/Logic/Holds.php
+++ b/module/finc/src/finc/ILS/Logic/Holds.php
@@ -231,7 +231,7 @@ class Holds extends \VuFind\ILS\Logic\Holds
                     $copy['emailHoldLink'] = $this->getRequestDetails(
                         $copy,
                         $requestConfig['HMACKeys'],
-                        'EmailHoldLink'
+                        'EmailHold'
                     );
 
                     $copy['checkEmailHold']
-- 
GitLab