I have a profile2 type with several field collections attached. Furthermore, one Search API index is used for the field collections.

When I want to save a new field collection and have the setting 'Index items immediately' activated, I receive following error:
EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (Line 7390 in common.inc).

This doesn't happen, if I update an existing field collection.

Comments

drunken monkey’s picture

Does it work with the latest dev (or did you try out #1263214: Indexing with „Index items immediately“ indexes old entity state before it was committed)?
Or did you just skim over it and said to yourself (or, possibly, myself) „that doesn't say anything about an exception“? :P

mh86’s picture

Latest dev doesn't change anything. Does immediately indexing of Field collections work for you? Maybe it's caused by some special configurations.

drunken monkey’s picture

It seems to be – for me, everything works fine with this setup. Even with a version from before the commit mentioned in #1.

However, I don't quite know what you mean with „save a new field collection“ – add a new field-collection field to an entity type, or save a new profile with such a field collection? Or … ?
I tested the former two, and everything else with profiles, field collections, etc., I could think about.
But maybe you can just show me in person which steps are needed to reproduce this. (Didn't want to test with your test installation, so as not to mess things up.)

drunken monkey’s picture

Title: 'Index items immediately' broken for Field collections » Fix „Index items immediately“ to delay indexing on insert, too
Status: Active » Needs review
StatusFileSize
new466 bytes

Just realized that #1263214: Indexing with „Index items immediately“ indexes old entity state only fixes this for updates, not for inserts, so that might easily be the cause.

Patch attached.

mh86’s picture

Status: Needs review » Reviewed & tested by the community

yeah, it works now! Thanks :)

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great, committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.