diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php index 3f7120c9133b4420b14abf4b454c019e9b0089f3..873be5d80b9e8cd886753fd3d98b5e556b035d21 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php @@ -860,19 +860,12 @@ class SolrDefault extends AbstractBase public function getOpenURL() { // Set up parameters based on the format of the record: - switch ($format = $this->getOpenURLFormat()) { - case 'Book': - $params = $this->getBookOpenURLParams(); - break; - case 'Article': - $params = $this->getArticleOpenURLParams(); - break; - case 'Journal': - $params = $this->getJournalOpenURLParams(); - break; - default: + $format = $this->getOpenURLFormat(); + $method = "get{$format}OpenURLParams"; + if (method_exists($this, $method)) { + $params = $this->$method(); + } else { $params = $this->getUnknownFormatOpenURLParams($format); - break; } // Assemble the URL: