When indexing, in the event that an entity contains a field but that field does not contain a value it still proceeds and tries to foreach through that array (which wouldn't be an array) and therefore you receive the following error:
Invalid argument supplied for foreach() callback_attachments_references_settings.inc:38
My proposed solution would be to check if the referenced entities is empty, and continue with the next field if it is.
// Manage case of field having no value and continue with next field.
if (empty($referenced_entities)) {
continue;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2998963-check-for-results-before-looping.patch | 1.06 KB | andy_w |
Comments
Comment #2
andy_w commentedPatch attached to check for results.
Comment #3
izus commentedok
thanks for this
Comment #5
izus commentedit's merged :)