From f62308bb9308fde5aa3a43d40cdd7377884c3e8f Mon Sep 17 00:00:00 2001
From: "Chris Delis (CARLI)" <cedelis@uillinois.edu>
Date: Mon, 17 Sep 2018 11:14:15 -0500
Subject: [PATCH] Bug fix: StatusRankings does not work. Rankings are only
 compared to the first status ranking. This method needs to choose the minimum
 status ranking among *all* statuses.

---
 module/VuFind/src/VuFind/ILS/Driver/Voyager.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
index cc7992e3f0f..409095d5755 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php
@@ -244,8 +244,10 @@ class Voyager extends AbstractBase
         $status = $statusArray[0];
         $rank = $this->getStatusRanking($status);
         for ($x = 1; $x < count($statusArray); $x++) {
-            if ($this->getStatusRanking($statusArray[$x]) < $rank) {
+            $thisRank = $this->getStatusRanking($statusArray[$x]);
+            if ($thisRank < $rank) {
                 $status = $statusArray[$x];
+                $rank = $thisRank;
             }
         }
 
-- 
GitLab