Zend Viewrenderer null value

We are having a problem where specific pages of search results don’t render with an error. We are running both the solrsearch plugin and the cleanURL plugin, and while the error seems to issue in cleanURL, from the stack trace, it looks like the problem is that the Zend view renderer is passing a null value to both of those plugins in place of legit record data/urls. Stack trace is posted below . You can see the error in the front-end by going to:

https://digitalcollections.library.gvsu.edu/solr-search?q=theater&page=3

Any ideas what’s causing this? It’s odd that it only happens on specific pages of the search results, and only for specific searches-accessing the page before or after three, in this case, works fine.

2021-06-17T13:53:38+00:00 ERR (3): Omeka_View_Exception: Invalid record passed while getting record URL. in /var/www/html/omeka/plugins/CleanUrl/views/helpers/RecordUrl.php:37
Stack trace:
#0 /var/www/html/omeka/application/libraries/Zend/View/Abstract.php(349): CleanUrl_View_Helper_RecordUrl->recordUrl(NULL, ‘show’, false, Array)
#1 /var/www/html/omeka/application/libraries/globals.php(3283): Zend_View_Abstract->__call(‘recordUrl’, Array)
#2 /var/www/html/omeka/plugins/SolrSearch/helpers/SolrSearch_Helpers_Index.php(155): record_url(NULL, ‘show’)
#3 /var/www/html/omeka/plugins/SolrSearch/helpers/SolrSearch_Helpers_View.php(93): SolrSearch_Helpers_Index::getUri(NULL)
#4 /var/www/html/omeka/plugins/SolrSearch/views/shared/results/index.php(128): SolrSearch_Helpers_View::getDocumentUrl(Object(Apache_Solr_Document))
#5 /var/www/html/omeka/application/libraries/Omeka/View.php(114): include(’/var/www/html/o…’)
#6 /var/www/html/omeka/application/libraries/Zend/View/Abstract.php(888): Omeka_View->_run(’/var/www/html/o…’)
#7 /var/www/html/omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render(NULL)
#8 /var/www/html/omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(933): Zend_Controller_Action_Helper_ViewRenderer->renderScript(‘results/index.p…’, NULL)
#9 /var/www/html/omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(972): Zend_Controller_Action_Helper_ViewRenderer->render()
#10 /var/www/html/omeka/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#11 /var/www/html/omeka/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#12 /var/www/html/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch(‘indexAction’)
#13 /var/www/html/omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /var/www/html/omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#15 /var/www/html/omeka/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#16 /var/www/html/omeka/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#17 /var/www/html/omeka/index.php(23): Omeka_Application->run()
#18 {main}

The problem here is likely going to be that the item is private, or has been deleted, something like that, but is still being returned from Solr.

The ID is coming from Solr’s index here, and somewhere in the search results view (or controller) it gets the Item record for that ID, but since the item is actually private (or deleted) a null value is returned instead.

In terms of fixing the view it could simply check for a null record and skip displaying it or show some error. The fundamental solution is likely to be fixing whatever has the Solr index not matching up with the Omeka database. Simply reindexing may be a solution if it was a one-time problem that caused this.

I don’t think CleanUrl specifically has anything to do with this, it’s just involved in your stack trace because the Solr search results page is trying to get the URLs for each result, and this involves CleanUrl.