diff --git a/module/VuFind/src/VuFind/Controller/Plugin/Holds.php b/module/VuFind/src/VuFind/Controller/Plugin/Holds.php index ba68d708f8032294f91633d573b7dc7386cd5331..b8ce7380ec049f8beb95634b7f49c4d0bfe8844a 100644 --- a/module/VuFind/src/VuFind/Controller/Plugin/Holds.php +++ b/module/VuFind/src/VuFind/Controller/Plugin/Holds.php @@ -58,14 +58,29 @@ class Holds extends AbstractRequestBase // Build OPAC URL $ilsDetails['cancel_link'] = $catalog->getCancelHoldLink($ilsDetails); + } else if (isset($ilsDetails['cancel_details'])) { + // The ILS driver provided cancel details up front. If the + // details are an empty string (flagging lack of support), we + // should unset it to prevent confusion; otherwise, we'll leave it + // as-is. + if ('' === $ilsDetails['cancel_details']) { + unset($ilsDetails['cancel_details']); + } else { + $this->rememberValidId($ilsDetails['cancel_details']); + } } else { - // Form Details + // Default case: ILS supports cancel but we need to look up + // details: $cancelDetails = $catalog->getCancelHoldDetails($ilsDetails); if ($cancelDetails !== '') { $ilsDetails['cancel_details'] = $cancelDetails; $this->rememberValidId($ilsDetails['cancel_details']); } } + } else { + // Cancelling holds disabled? Make sure no details get passed back: + unset($ilsDetails['cancel_link']); + unset($ilsDetails['cancel_details']); } return $ilsDetails;