Catchable fatal error: Argument 2

When performing a search from browse items page results are returned successfully, but also includes this error:

Catchable fatal error: Argument 2 passed to set_current_record() must be an instance of Omeka_Record_AbstractRecord, null given, called in (my_host_path)/omeka-2.2.2/application/views/scripts/search/index.php on line 22 and defined in (my_host_path)/omeka-2.2.2/application/libraries/globals.php on line 1814

Line 22 referenced above:

<?php set_current_record($recordType, $record); ?>

Line 1814 referenced above:

function set_current_record($recordVar, Omeka_Record_AbstractRecord $record, $setPreviousRecord = false)
{
    get_view()->setCurrentRecord($recordVar, $record, $setPreviousRecord);
}

Any ideas on how to resolve?

Sam

CORRECTION: Search results are NOT consistent

A null there means that Omeka wasn't able to find the record it was trying to print while displaying the search results.

Do the results change if you're logged in or not? Is this just a problem when doing a search from the items/browse page specifically, or from any page?

John -
Interestingly - it does not happen if I'm NOT logged in. So, that's a relief.
This is the search 'bar' that appears on the left side in the default theme. I cannot get results via the search TAB.
This is also a testing installation only that is currently populated with 100+ PDFs with embedded text.
SITE:
http://myownspace.us/ngadeeds/omeka-2.2.2/

I really like the way it displays the embedded text when reviewing the item found.

Thanks for the suggestion. I'm not sure if the errors are something worth fixing?

Sam

I am having a similar problem.
When making a search, items on the first page are not shown and instead get the following error.

Catchable fatal error: Argument 2 passed to set_current_record() must be an instance of Omeka_Record_AbstractRecord, null given, called in web/collections/application/views/scripts/search/index.php on line 22 and defined in web/collections/application/libraries/globals.php on line 1808

Line 22
set_current_record($recordType, $record);

Line 1808

function set_current_record($recordVar, Omeka_Record_AbstractRecord $record, $setPreviousRecord = false)
{
    get_view()->setCurrentRecord($recordVar, $record, $setPreviousRecord);
}

Error comes up only when admin is logged out.

However other pages with items can be navigated with pagination and no error is thrown. It shows up when ever a search is made on the home, collections, or items page.

Update:
Looks like the public items are causing the error. When I set an item to public = 1, the error does not appear.

Does the error persist if you re-index by clicking "Index Records" under Settings -> Search?

Wonderful, re-indexing seems to work. The searches are free of errors on home, collections and items pages.

Thank you very much.