For Search API attachments, 7.x-1.13. This error is reported on Node save event.
Recoverable fatal error: Argument 2 passed to SearchApiAttachmentsAlterSettings::isFileIndexable() must be of the type array, object given, called in sites/all/modules/contrib/search_api_attachments/includes/callback_attachments_settings.inc on line 43 and defined in SearchApiAttachmentsAlterSettings->isFileIndexable() (line 73 of sites/all/modules/contrib/search_api_attachments/includes/callback_attachments_settings.inc).
Looks like this was introduced when doing a "coding standards" clean up. Explicit array declaration was added to a function, which caused the issue. The variable is object, not an array.
Patch to be attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | search_api_attachments-2971834-1.patch | 1.01 KB | agileware |
Comments
Comment #2
agileware commentedPatch attached to fix this issue.
Comment #3
agileware commentedChanging priority as the impact is a error message on node save.
Comment #4
markandrewsuttonI had the same issue with 7.x-1.12 and reported it here. https://www.drupal.org/project/search_api_attachments/issues/2971675
Same issue, but in my patch, I changed the function call rather than the function itself. This way the coding standards are maintained.
Not sure if this should be considered a duplicate issue?
Comment #5
agileware commented@markandrewsutton the module uses $item as an object. Casting it as an array just to satisfy the function declaration as you did in 2971675 is OK as long as it updates all references.
The easiest solution IMHO is just to remove the array casting from the function.
I think the automated Drupal coding standards, read the comments for the function, which incorrectly listed item as an array. Then introduced the bug by prefixing array function declaration - that's the problem.
Comment #6
markandrewsutton@agileware thanks for the explanation. This makes good sense. I'm going to update the other issue so others know to use this patch. Thanks!
Comment #7
helmo commentedThanks, #2 works.
Comment #9
izus commentedThanks all
This is now merged
EDIT : new release 7.x-1.14 is available