Maybe thats another issue for #1007830: Nested transactions throw exceptions when they got out of scope

My entity definition looks like

$return['datastore_domain'] = array(
    'label' => t('Domain type'),
    'entity class' => 'Entity',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'datastore_domain',
    'fieldable' => FALSE,
    'bundle of' => 'datastore',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'domain',
      'label' => 'label',
    ),
    'access callback' => 'datastore_entity_domain_access',
    'module' => 'datastore_entity',
    'admin ui' => array(
      'path' => 'admin/structure/datastore_domains',
      'file' => 'datastore_entity.admin.inc',
      'controller class' => 'DataStoreDomainUIController',
    ),
  );

and my implementation of hook_default_{entity_type} like

function datastore_system_default_datastore_domain() {
  $domain['system'] = datastore_domain_create(array(
      'domain' => 'system',
      'label' => t('System'),
  ));
  
  return $domain;
}

calling

$ds = datastore_domain_create(array(
      'domain' => 'system_test,
      'label' => t('System test'),
  ));

datastore_domain_save($ds);

from devels php execution page works fine. datastore_domain_create uses entity_create($entity_type, $values);

Do you know if there is something wrong with the entity definition or is it another consequence of the nested transactions bug?

Comments

fago’s picture

hm, I never ran about that when providing defaults. Are you using a recent drupal core?

The definition looks good to me.

nodestroy’s picture

Status: Active » Closed (fixed)

actually this is fixed with 7.x-dev (2011-Aug-16)