_eva_extract_entity_from_build() can attempt to return an undefined variable. Attached patch fixes this.

CommentFileSizeAuthor
eva-fix-entity-notice.patch978 bytesjames.williams
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fonant’s picture

Patch fixes the problem for me, and seems to make sense logically too :)

GiorgosK’s picture

Status: Active » Reviewed & tested by the community

notice goes away when we apply the patch
please commit

stevector’s picture

Title: Notice: Undefined variable: entity » Notice: Undefined variable: entity and EntityMalformedException
Priority: Normal » Major

I'm bumping the priority on this patch because it also fixes an error that kills the rest of the page.

EntityMalformedException: Missing bundle property on entity of type field_collection_item. in entity_extract_ids() (line 7389 of drupalroot/includes/common.inc).
Remon’s picture

pretty straightforward :)

eaton’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to the dev branch -- will go into the next release. Thanks!

chekka.de’s picture

Great! DRUPAL Community ist really awesome!
I just searched for »EntityMalformedException« ... and all my problems are gone. (o:

Thanks

james.williams’s picture

Glad to hear I could help with *all* of your problems!!

mgladding’s picture

Status: Fixed » Active

I may be having a similar problem, but in relation to the Drupal Commerce module. If I need to open a new issue, please let me know.

I am getting the following errors:

Notice: Undefined variable: entity in _eva_extract_entity_from_build() (line 148 of .../sites/all/modules/eva/eva.module).

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

I upgraded to the dev version, but it didn't resolve the problem.

Thanks in advance for any help!

eaton’s picture

mgladding, I think that may be something different -- it sounds like the actual entity bundle itself from Drupal Commerce isn't coming in with a bundle type, and one of Drupal's internal functions is choking trying to process it before EVA even touches it. I'll take a closer look, but are you seeing this with any other entity types?

mgladding’s picture

Just when I try to complete the checkout process. I've disabled the EVA module and that fixed the problem. Not my ideal solution since I'd like to use the functionality of EVA.

eaton’s picture

Just when I try to complete the checkout process. I've disabled the EVA module and that fixed the problem. Not my ideal solution since I'd like to use the functionality of EVA.
What entity are you attaching it to, and does it display correctly when the entity is being displayed in other contexts? (ie, on a view page)?

mgladding’s picture

I haven't actually used the module yet. I just enabled it and got the error when I tried to checkout.

eaton’s picture

I haven't actually used the module yet. I just enabled it and got the error when I tried to checkout.

Well, that's DOUBLY odd. From that description, it sounds like Drupal Commerce isn't generating a well-constructed entity object, because the failure is occurring in the internal Drupal function that extracts an entity ID...

webankit’s picture

+1

zambrey’s picture

Well, I've had this issue on Commerce checkout process but installing latest EVA dev version fixed that error.

joachim’s picture

If it's any help, I enabled commerce_devel module and got this from the error when I try to advance from the billing commerce checkout pane:

    Notice: Undefined variable: entity in _eva_extract_entity_from_build() (line 148 of /Users/joachim/Sites/greaves-drupal/sites/all/modules/contrib/eva/eva.module). Backtrace:

    _eva_extract_entity_from_build(Array) eva.module:48
    eva_entity_view_alter(Array, 'commerce_customer_profile', NULL) module.inc:1003
    drupal_alter(Array, Array, 'commerce_customer_profile') commerce.controller.inc:340
    DrupalCommerceEntityController->view(Array, 'customer', NULL, NULL) entity.module:400
    entity_view('commerce_customer_profile', Array, 'customer') commerce_customer.checkout_pane.inc:170
    commerce_customer_profile_pane_review(Array, Array, Array, Object) commerce_checkout.checkout_pane.inc:34
    commerce_checkout_review_pane_checkout_form(Array, Array, Array, Object) commerce_checkout.pages.inc:103
    commerce_checkout_form(Array, Array, Object, Array) 
    call_user_func_array('commerce_checkout_form', Array) form.inc:785
    drupal_retrieve_form('commerce_checkout_form_review', Array) form.inc:329
    drupal_build_form('commerce_checkout_form_review', Array) form.inc:123
    drupal_get_form('commerce_checkout_form_review', Object, Array) commerce_checkout.pages.inc:58
    commerce_checkout_router(Object, Array) 
    call_user_func_array('commerce_checkout_router', Array) menu.inc:503
    menu_execute_active_handler() index.php:21

    EntityMalformedException: Missing bundle property on entity of type commerce_customer_profile. in entity_extract_ids() (line 7405 of /Users/joachim/Sites/greaves-drupal/includes/common.inc). Backtrace:

    entity_extract_ids('commerce_customer_profile', NULL) eva.module:50
    eva_entity_view_alter(Array, 'commerce_customer_profile', NULL) module.inc:1003
    drupal_alter(Array, Array, 'commerce_customer_profile') commerce.controller.inc:340
    DrupalCommerceEntityController->view(Array, 'customer', NULL, NULL) entity.module:400
    entity_view('commerce_customer_profile', Array, 'customer') commerce_customer.checkout_pane.inc:170
    commerce_customer_profile_pane_review(Array, Array, Array, Object) commerce_checkout.checkout_pane.inc:34
    commerce_checkout_review_pane_checkout_form(Array, Array, Array, Object) commerce_checkout.pages.inc:103
    commerce_checkout_form(Array, Array, Object, Array) 
    call_user_func_array('commerce_checkout_form', Array) form.inc:785
    drupal_retrieve_form('commerce_checkout_form_review', Array) form.inc:329
    drupal_build_form('commerce_checkout_form_review', Array) form.inc:123
    drupal_get_form('commerce_checkout_form_review', Object, Array) commerce_checkout.pages.inc:58
    commerce_checkout_router(Object, Array) 
    call_user_func_array('commerce_checkout_router', Array) menu.inc:503
    menu_execute_active_handler() index.php:21

joachim’s picture

> Well, I've had this issue on Commerce checkout process but installing latest EVA dev version fixed that error.

Ditto -- installing the dev version fixed this.

@eaton: can we have a new release please?

beckyjohnson’s picture

I am having this issue as well.

I received this message:

Notice: Undefined variable: entity in _eva_extract_entity_from_build() (line 148 of /var/www/vhosts/xxxxxx/subdomains/xxxxx/httpdocs/sites/all/modules/eva/eva.module).

EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (line 7389 of /var/www/vhosts/xxxxxx/subdomains/xxxxxx/httpdocs/includes/common.inc).

It happened right after I input my user location in my profile using the location / gmap modules.

Any ideas?

tehbmar’s picture

I had the same error message

"EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (line 7405 of /var/www/xxxxxx/includes/common.inc)."

But I couldn't help but notice you have a different line number (7389 as compared to 7405) so I would suggest updating your core version, profile2, and installing the latest dev version for eva. That was the fix for my install.

Currently I have...

Core: 7.9
Eva: 7.x-1.x-dev (2011-Sep-19)
Profile2: 7.x-1.1

Also, don't forget to "drush updb" (or you can run http://example.com/update.php)

beckyjohnson’s picture

Yeah I started using the dev versions of entity and profile 2 and the error went away....

tehbmar’s picture

Yay, glad to see that everything worked out

czigor’s picture

Status: Active » Fixed

I had the same problem as in #8. I'm not using profile2 (as in #19). Updating to latest dev of EVA solved it for me.

Status: Fixed » Closed (fixed)

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

damien_vancouver’s picture

Also experienced problem from #8, running 7.x-1.1. I don't use profile2, but am using Drupal Commerce.

As in #22, Upgrading to the latest 7.x-1.x-dev (2011-Sep-19) solved the problem for me, error message is gone!

MrPaulDriver’s picture

Same problem as #18 with profile2.

Confirm that dev version (2011-Sep-19) of EVA fixes the problem

sensei-master’s picture

Patch works good! Thanks!

occucopy’s picture

Agree w/ #20, 22, 24, 25, etc. Hooray!

zabelc’s picture

I didn't have profile 2, but I did have the error above, and switching to the dev version fixed it. Any chance of a second stable release sometime?

drupalerocant’s picture

I had the same problem, with profile2 installed. I was lucky just today was realeased the stable version 1.2 which fixes the problem.
Thanks everybody!

Mile23’s picture

So the fix is to install EVA 7.x-1.2?

peterg.griffin’s picture

Issue summary: View changes

Dev-version still gave issues, but updating to 7.x-1.2 fixed the issue.