Error message when searching Omeka

Hi everyone,

We are currently getting error messages when performing certain searches in our Omeka Classic instance. I have not been able to identify a clear pattern. Sometimes it happens when searching by keywords, sometimes when navigating through the pages of results (some pages are fine, others return the error message).
If anyone can help us decipher the error messages and suggest a solution we would be very grateful!

  • We are running Omeka Classic version 2.4.1
  • We have the Solr Search plugin activated (version 2.3.0)
  • We are running Solr version 4.10.4 (we had issues with a later version of Solr, so rolled back to this older one).

This is an example of the error message:
Omeka has encountered an error

Omeka_View_Exception

Invalid record passed while getting record URL.

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

This is an example of an error log:

[Mon Jul 16 10:08:25.520533 2018] [:error] [pid 2982] [client 118.138.234.142:45714] PHP Warning: First parameter must either be an object or the name of an existing class in /omeka/web/default/plugins/SolrSearch/helpers/SolrSearch_Helpers_Index.php on line 152, referer: …

which point to line 152 of this code:

136 public static function getUri($record)
137 {
138 $uri = ‘’;
139 $action = ‘show’;
140 $rc = get_class($record);
141
142 if ($rc === ‘SimplePagesPage’) {
143 $uri = url($record->slug);
144 }
145
146 else if ($rc === ‘ExhibitPage’) {
147
148 $exhibit = $record->getExhibit();
149 $exUri = self::getSlugUri($exhibit, $action);
150 $uri = “$exUri/$record->slug”;
151
152 } else if (property_exists($record, ‘slug’)) {
153 $uri = self::getSlugUri($record, $action);
154 } else {
155 $uri = record_url($record, $action);
156 }
157
158 // Always index public URLs.
159 $uri = preg_replace(’|/admin/|’, ‘/’, $uri, 1);
160
161 return $uri;
162 }