From e3830f9800c6abbda441a5b0d84986f3c5c3530f Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 16 May 2013 12:11:12 -0400
Subject: [PATCH] Fixed broken new items RSS feed.

---
 .../src/VuFind/Controller/SearchController.php       | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php
index 4d42b631bcb..ef7a1826242 100644
--- a/module/VuFind/src/VuFind/Controller/SearchController.php
+++ b/module/VuFind/src/VuFind/Controller/SearchController.php
@@ -408,10 +408,14 @@ class SearchController extends AbstractSearch
         // Call rather than forward, so we can use custom template
         $view = $this->resultsAction();
 
-        // Customize the URL helper to make sure it builds proper reserves URLs:
-        $url = $view->results->getUrlQuery();
-        $url->setDefaultParameter('range', $range);
-        $url->setDefaultParameter('department', $dept);
+        // Customize the URL helper to make sure it builds proper reserves URLs
+        // (check it's set first -- RSS feed will return a response model rather
+        // than a view model):
+        if (isset($view->results)) {
+            $url = $view->results->getUrlQuery();
+            $url->setDefaultParameter('range', $range);
+            $url->setDefaultParameter('department', $dept);
+        }
 
         return $view;
     }
-- 
GitLab