Sometimes when entity module rebuild the entity the $entity->original property can get assigned FALSE.
$entity->original = !empty($existing_entities[$name]) ? $existing_entities[$name] : FALSE;
If this the case and entity_update is fired it means that the line
if (isset($entity->original)) {
evaluates to true and entity_extract_ids throws a entitymalformedexception.
Proposed fix to just add an extra is_object check to the conditional.
| Comment | File | Size | Author |
|---|---|---|---|
| search_api-entitymalformedexceptionfix.patch | 619 bytes | ACF |
Comments
Comment #2
stan.ag commentedGot this error when deleting commerce products.
Why not simply change
isset($entity->original)to!empty($entity->original)in conditional?Comment #3
stan.ag commentedRestoring issue summary... :)
Comment #4
mbayntonEncountered this issue, confirmed the patch in the issue summary fixes it. If I were the maintainer I'd be calling for test coverage though.
Comment #5
drunken monkeyCommitted the fix with
!empty()instead ofisset(). Seems like poor code by the Entity API, though – but I guess just working around that is the best we can do.