I am trying to use Devel generate to generate some users, but I hit the following error:

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of .../includes/common.inc).

What I know is this:

- I use organic groups to create groups of content type "Community" which contain content types called "Project" (currently a Drupal 6 development version can be seen at http://dev.languageforge.org/ though the problem occurs in D7 with the latest Devel code, version = "7.x-1.3+37-dev").

- The error appears to be happening when generating some of the random content associated with a user.

- If I do a complete clean D7.19 install and create the Community as the OG "Group" and Project content type as "Group content", I do not get the error (so there is something a bit more subtle going on). This suggests it's something maybe that I've done to the group, but I don't know what, and I don't think that it should stop devel generate from creating users.

- In the clean D7.19 version, function _entityreference_devel_generate() does not find any $referencable_entity whereas in the version displaying the bug, $referenceable_entity is an array which looks like an array of all projects as follows: $referenceable_entity['community'] = array(3 => 'Arbereshe', 10=> 'Chamorro', ...)

- In the version displaying the bug, function entity_extract_ids($entity_type, $entity) gets passed $entity as FALSE, leading of course to the EntityMalformedException

- passed to entity_load_single($entity_type, $id) is $entity_type = 'node' and $id = 'community'.

- the entity.inc function load() does not return any entities

I have tried to figure out where the problem is, but I only get so far before I get lost in the complexity of the entity/bundle calls and what they all do.

CommentFileSizeAuthor
#9 og.module.diff689 bytestimaepi

Comments

drupalshrek’s picture

Project: Devel » Organic Groups
Issue summary: View changes

added extra know info

salvis’s picture

Project: Organic Groups » Devel
Category: bug » support

Thank you for the long story. At this point I see no indication for a bug in Devel.

I hope that someone can help...

btorgan’s picture

I have the exact same issue with the devel generate module. It seems to be a conflict with the Organic Groups module. When I use generate to create users it works fine, when I use it to generate content it works fine, but as soon as I have created a group or two and try to generate either content or users it throws the error message

EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of .../includes/common.inc)

It is very frustrating because after the code is thrown nothing can get generated as the code stops at the message. If the groups are deleted, then the generate works again. Don't know if Salvis is correct about devel, but in any case it is either devel or og. They are just not playing nice together. (using ver 7.21)

salvis’s picture

Project: Devel » Organic Groups
Version: 7.x-1.x-dev » 7.x-2.1
Component: devel_generate » og.module

Thank you for the additional information. This looks like OG needs some additional data for its content to be created. I'm moving this to the OG queue, because the OG maintainers are in a better position to diagnose the problem and figure out a cure.

In general, the support for non-core content is provided by the module that manages that content type (which makes sense if you think about it), but we can still discuss this once we've identified the problem.

mpotter’s picture

I am getting this same error when trying to use the Devel module to generate users on my Organic Groups site. Using OG 2.x-dev branch from Apr 2, 2013. The issue seems to be that the og_user_node field is getting filled with the names of the group bundles, rather than specific group ID values.

mpotter’s picture

I found that this was related to #1852112: Invalid field value with devel_generate in the entityreference module. Updating to the latest 1.x-dev of entityreference fixed my problem.

salvis’s picture

Thank you, mpotter!

@drupalshrek:
@btorgan:

Please try #5 — does this fix your problem?

amitaibu’s picture

Status: Active » Closed (duplicate)
amitaibu’s picture

Issue summary: View changes

added version of Devel code tested with

enavas’s picture

Version: 7.x-2.1 » 7.x-2.10
Category: Support request » Bug report
Status: Closed (duplicate) » Active

I have a bug. I am updating organic group module 7.x-2.9 to 7.x-2.10. When I try to create a node, Drupal show this error: “EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (línea 7950 line .../includes/common.inc).” . Can you help me find a solution?

timaepi’s picture

StatusFileSize
new689 bytes

I had the same problem. It looks like the if the function `og_is_group` gets passed an entity that does not exist, it passes the returned false value from `entity_load_single` to `entity_extract_ids`. `entity_extract_ids` expects a loaded entity, and when it doesn't get one, the error is thrown. Here is what I used to fix it.

JudyPJHsu’s picture

I also ran into this issue: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7942...

The error occurred when editing an og content--as a superuser it works, as the content creator it works, but the group admin didn't work, it threw up the EntityMalformedException. I applied #9 and that fixed it for all the og users.

Would it be related to this as well? https://www.drupal.org/project/og/issues/2250177#comment-12649851