I get the following error when saving a content item using this field widget:

EntityMalformedException: Missing bundle property on entity of type relation. in entity_extract_ids() (line 7389 of /drupal/includes/common.inc).

Comments

ben_scott’s picture

Sorry, I can't recreate this - what entity / bundle types are you linking from / to?

klonos’s picture

Title: Missing Bundle Property When Saving » EntityMalformedException: Missing bundle property on entity of type relation, entity_extract_ids() line 7389 of common.inc

...better issue title ;)

ni-ka’s picture

Priority: Normal » Critical

I'm getting the same error here. My relation is a directional relation between two Content Types (nodes). When I add the same relation through the Relation Add Block, everything is fine. However, if I attempt to add a relation on the edit page using the Select UI, I get the error described above.

I also noticed that when I try to save the edit form of a node where I previously added the relation via the Relation Add Block I get the following error (+the one described above):

Notice: Undefined index: 4 in relation_select_field_insert() (line 670 of D:\Projects\Danceit\acquia-drupal7\sites\all\modules\relation_select\relation_select.module).

I use the current Acquia drupal bundle, here the versions of several modules: entity (7.x-1.x-dev), relation (7.x-1.x-dev), CTools (7.x-1.x-dev)

busla’s picture

Getting this error when using Relation and Page Manager. I add a relation:id as an argument (relation/%relation/custom-page).

Anyone has an idea?

steveoliver’s picture

Priority: Critical » Major
Status: Active » Closed (cannot reproduce)

Just going through the queue looking to close critical issues and bugs.

relation_select_field_insert() has been changed a bit recently. I can't reproduce this error. Please try again and re-open this issue it persists.

Thanks.

steveoliver’s picture

I think I was able to reproduce this error when cloning a node (using node_clone module).

I got these errors when cloning a node which had relation_select fields:

    Notice: Undefined index: {previous_relation_rid} in relation_select_field_insert() (line 684 of relation_select.module).
    Notice: Undefined property: stdClass::$relation_type in relation_select_field_insert() (line 691 of relation_select.module).
    EntityMalformedException: Missing bundle property on entity of type relation. in entity_extract_ids() (line 7501 of /includes/common.inc).

When reviewing relation_select_field_insert(), I noticed that we weren't properly dealing with the three scenarios for relation select fields:

1. Create new relation.
2. Update existing relation.
3. Delete relation which no longer has endpoints set.

The cleanup in commit c3b0bf3 may help your situation. Please update to the latest 7.x-1.x-dev and let me know if it helps your situation(s).

Possibly related: #1334286: When opening Content / Relations tab in admin UI -> EntityMalformedException: Missing bundle property on entity of type relation.

steveoliver’s picture

Status: Closed (cannot reproduce) » Closed (fixed)

Changing issue status.

mvlabat’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work

The way to reproduce this bug again:

  1. Modules to have installed on a clean Drupal (including their dependencies):
    • Field collection
    • Relation add
  2. Create a relation type.
  3. Create a content type with relation_add and field_collection fields.
  4. Add any field to a newly created field collection (a text field, for instance).
  5. Create a node and fill all the fields (relation_add and field_collection ones are important) with any values.
  6. Try to delete the node.

That is what you will get:

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

mvlabat’s picture

Status: Needs work » Closed (fixed)

Sorry, didn't notice this is "Relation select" module issue, when googling this error. )
This bug, as I found, relates straightly to Relation module.