Not sure weather this issue belongs in the eva module section or ubercart section. the error directs to eva module but is generated when using ubercarts

The issue is created when a user adds an item to the ubercart.

Im using profile2/ profile reg path to create custom registration pages that allow members to sign up for certain roles. Both roles and user system is based on a premium membership site, so the user must pay for access, after registration they are directed to the ubercart where they must complete payment to be assigned the role. Once the user is directed to the ubercart and adds the membership type to there cart this error is presented

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

That line relates to this function

function _eva_extract_entity_from_build($build) {
  // EntityAPI often sticks stuff in here.
  if (!empty($build['#entity'])) {
    return $entity;
  }
  
  // Other entities stick them here!
  elseif (!empty($build['#' . $build['#entity_type']])) {
    return $build['#' . $build['#entity_type']];
  }

  // Some entities are naughty.
  elseif ($build['#entity_type'] == 'user') {
    return $build['#account'];
  }
  elseif ($build['#entity_type'] == 'taxonomy_term') {
    return $build['#term'];
  }

  return FALSE;
}

Any help apprectiated

Comments

mkadin’s picture

We're seeing some issues with profile 2 that need to be sorted out probably. #1574992: Attached view no longer displays after user edits Profile 2 for example. Profile 2 might not follow conventions in where it stores its entity type in the build array. I'm looking into it.

jkirkby’s picture

Ok thanks!! let me know if you need any more information.

jkirkby’s picture

Seeing more errors this time when i go admin -> people and click on a users name to view there profile

    Notice: Undefined variable: entity in _eva_extract_entity_from_build() (line 148 of /path-to-drupal/sites/all/modules/eva/eva.module).
    EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (line 7501 of /path-to-drupal/includes/common.inc).
mkadin’s picture

Status: Active » Closed (duplicate)

This is actually a duplicate of this: #1298864: Error while viewing nodes with field collections when eva module enabled. Sorry for not recognizing this. A new release with the fix is coming soon. Or you can use the dev release to get the fix now.