Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Framework
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 11:13 UTC
Updated:
7 Mar 2011 at 23:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
drunken monkeySince the error doesn't occur here: could you tell me, where in the Search API the exception occurs? In
search_api_extract_fields(), which does the heavy lifting for extracting the data from the indexed items, all exceptions should be caught.Comment #2
drunken monkeyIf the issue is still present, please re-open with additional information.
Comment #3
fagoYep, it still appears. I tracked it down to search_api_extract_fields(). The tricky thing is it appears when iterating over a wrapper, as iterating over a list needs to fetch the values to determine the keys, it can cause an exception. So best, just catch the EntityMetadataWrapperException for the whole function.
Comment #4
fagoattached patch fixes it for me.
Comment #5
fagoProbably we should always return an array though.
Comment #6
fagohm, that patch caused troubles when some values where empty. Improved variant attached.
Comment #7
drunken monkeyThanks for the patch!
Just to clarify: the error occurs when the given
$wrapperis of a list type, but withNULL(or another non-array) as the value? Or when it is a list with a somehow faulty or inaccessible element?Comment #8
fagoI think it occurs if the value for the list itself cannot be loaded, thus causing an exception directly in
foreach ($list_wrapper as $item)
Comment #9
drunken monkeyOK, then there really doesn't seem to be anything else we can do.
Committed your last patch, thanks again!