I'm using field_collection to store a list of files with associated metadata.

When using such collections on a node the following Exception is thrown from common.inc

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids()

I tracked this back to this module, which is calling _apachesolr_attachments_update_parent_entity when inserting an entity.

_apachesolr_attachments_update_parent_entity makes the assumption that the entity is of type "node", when in fact the entity type should be "field_collection_item"

Patch attached

Comments

thtas’s picture

Issue summary: View changes
StatusFileSize
new827 bytes
chrisivens’s picture

I can confirm that this is an error. Patch seems to work on initial testing.

Angry Dan’s picture

Status: Needs review » Reviewed & tested by the community

This is exactly what I just found - file field attached to a field collection item.

Not too sure about the rest of the function either. I've not looked too far into it, but it seems to make the assumption that a file will only ever be attached to one field:

$parents_list = $parents ? reset($parents) : NULL;

Also, wondering if it should be using entity_revision_load, given file_get_file_references returns vid's?

jummonk’s picture

I concur issue and solution. In my case it was caused when I tried to add the same video to a translated node where the video is a field of a field_collection on the node.

David_Rothstein’s picture

Adding a couple issues that seem like duplicates of this one. (Although actually the first one is older and has had a similar patch sitting there for a long time.)

David_Rothstein’s picture

StatusFileSize
new769 bytes

Rerolled the patch to apply correctly via Git.

gabesullice’s picture

+1 for #6

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

thanks - sorry for the delay.

  • pwolanin committed 3190623 on 7.x-1.x
    Issue #2195095 by thtas, David_Rothstein: Error when trying using a file...

Status: Fixed » Closed (fixed)

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