diff --git a/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php b/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php index f12a9e5043864ccea8aecb9318ef5f6d8f404823..8548ad130dd37a3d552a2786451510016632b966 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php @@ -149,7 +149,17 @@ class ResultFeed extends AbstractHelper $entry->setTitle(empty($title) ? $record->getBreadcrumb() : $title); $serverUrl = $this->getView()->plugin('serverurl'); $recordLink = $this->getView()->plugin('recordlink'); - $entry->setLink($serverUrl($recordLink->getUrl($record))); + try { + $url = $serverUrl($recordLink->getUrl($record)); + } catch (\Zend\Mvc\Router\Exception\RuntimeException $e) { + // No route defined? See if we can get a URL out of the driver. + // Useful for web results, among other things. + $url = $record->tryMethod('getUrl'); + if (empty($url) || !is_string($url)) { + throw new \Exception('Cannot find URL for record.'); + } + } + $entry->setLink($url); $date = $this->getDateModified($record); if (!empty($date)) { $entry->setDateModified($date);