Closed (fixed)
Project:
Entity API
Version:
7.x-1.0-beta10
Component:
Entity CRUD controller
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Aug 2011 at 09:17 UTC
Updated:
18 Aug 2011 at 13:33 UTC
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
Comment #1
fagohm, I never ran about that when providing defaults. Are you using a recent drupal core?
The definition looks good to me.
Comment #2
nodestroy commentedactually this is fixed with 7.x-dev (2011-Aug-16)