From cb27b6819844e11a03e892a87a9f833186ade201 Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Tue, 10 May 2016 15:59:35 -0400
Subject: [PATCH] Fix request group handling in hold function - it is possible
 for there to be more than one request group for an item level hold.

---
 module/VuFind/src/VuFind/Controller/HoldsTrait.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/Controller/HoldsTrait.php b/module/VuFind/src/VuFind/Controller/HoldsTrait.php
index 2c03ba0bb90..5312d88412d 100644
--- a/module/VuFind/src/VuFind/Controller/HoldsTrait.php
+++ b/module/VuFind/src/VuFind/Controller/HoldsTrait.php
@@ -100,7 +100,8 @@ trait HoldsTrait
         $requestGroupNeeded = in_array('requestGroup', $extraHoldFields)
             && !empty($requestGroups)
             && (empty($gatheredDetails['level'])
-                || $gatheredDetails['level'] != 'copy');
+                || ($gatheredDetails['level'] != 'copy'
+                    || count($requestGroups) > 1));
 
         $pickupDetails = $gatheredDetails;
         if (!$requestGroupNeeded && !empty($requestGroups)
-- 
GitLab