Hello,

Wile installing Content Access for the first time expereienced the following error while trying to rebuild the permissions table.

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=107&op=do StatusText: Service unavailable (with message) ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7405 /common.inc).

I have tried my best to debug the problem by reading other posts and process of elimination but have not been able to successfully rebuild the Permissions Table when Content Access is enabled.

Steps Tried:

  1. Making use of AEGir created a new site using the same platform / code base. D7.9
  2. With no modules enabled - created some dummy content and enabled the module. -- Enabled Does not appear to be a platform / Core issue.
  3. Making use of AEGir cloned the site and slowly started to turn off modules.
  4. No matter on or off the problem would persist if tried to enable Content Access and rebuild the permissions.
  5. When Content Access is disabled I am able to rebuild the permissions table with no problem.
  6. I have made use of both the Beta-1 and Dev module in my testing.

For Reference line 7405 of my common.inc reads:

* Helper function to extract id, vid, and bundle name from an entity.
 *
 * @param $entity_type
 *   The entity type; e.g. 'node' or 'user'.
 * @param $entity
 *   The entity from which to extract values.
 * @return
 *   A numerically indexed array (not a hash table) containing these
 *   elements:
 *   0: primary id of the entity
 *   1: revision id of the entity, or NULL if $entity_type is not versioned
 *   2: bundle name of the entity
 */
function entity_extract_ids($entity_type, $entity) {
  $info = entity_get_info($entity_type);

  // Objects being created might not have id/vid yet.
  $id = isset($entity->{$info['entity keys']['id']}) ? $entity->{$info['entity keys']['id']} : NULL;
  $vid = ($info['entity keys']['revision'] && isset($entity->{$info['entity keys']['revision']})) ? $entity->{$info['entity keys']['revision']} : NULL;

  if (!empty($info['entity keys']['bundle'])) {
    // Explicitly fail for malformed entities missing the bundle property.
    if (!isset($entity->{$info['entity keys']['bundle']}) || $entity->{$info['entity keys']['bundle']} === '') {

throw new EntityMalformedException(t('Missing bundle property on entity of type @entity_type.', array('@entity_type' => $entity_type)));

    }
    $bundle = $entity->{$info['entity keys']['bundle']};
  }
  else {
    // The entity type provides no bundle key: assume a single bundle, named
    // after the entity type.
    $bundle = $entity_type;
  }

  return array($id, $vid, $bundle);
}

Thank you in advance to any and all help in deploying this module.

Comments

hyperglide’s picture

Issue summary: View changes

typos

hyperglide’s picture

Category: bug » support
Status: Active » Closed (fixed)

Solved -- can see solution and notes here -- http://drupal.org/node/1329872#comment-5322058

Was not a bug -- changed status.

hyperglide’s picture

Issue summary: View changes

formatting.