I created an entity type using Entity API and made it exportable. The export
link works properly but on Import
I have this error:
Fatal error: Call to a member function label() on a non-object in [...]\sites\all\modules\entity\entity.module on line 903
I couldn't find any reason.
Here's my hook_entity_info()
:
$return = array(
'event' => array(
'label' => t('Event'),
'entity class' => 'EventClass',
'controller class' => 'EventController',
'base table' => 'calendar_events',
'fieldable' => TRUE,
'entity keys' => array(
'id' => 'eid',
),
'load hook' => 'events_load',
'view modes' => array(
'full' => array(
'label' => t('Default'),
'custom settings' => FALSE,
),
),
'label callback' => 'entity_class_label',
'uri callback' => 'entity_class_uri',
'module' => 'events',
'access callback' => 'event_access',
'exportable' => TRUE,
'admin ui' => array(
'path' => 'admin/structure/events',
'file' => 'events.admin.inc',
'controller class' => 'EventsUIController',
),
),
);
Tell me if you need more information.
[EDIT]
I figured that the error has been occurred in entity_class_label($entity)
in sites/all/modules/entity/entity.module:903
. I printed the content of $entity
and it seems it is NULL
!
Why is it NULL
?
debug_backtrace
call