I have a custom built using Entity API which is fieldable which is working fine till now.

Now I have added a field collection using field UI, but as per project requirement we need the fields inside the field collection to come from a custom entity.

Is there any way of doing this?

Currently in the entity_info I have declared the entity as

$info['en_projects_details'] = array(
'label' => t('Project Details'),
'base table' => 'en_projects_details',
'entity keys' => array(
  'id' => 'id',
  'label' => 'name',
'module' => 'entity_test',
'entity class' => 'ProjectDetailsEntity',
'controller class' => 'ProjectEntityController',
'access callback' => 'entity_test_access_callback',
'uri callback' => 'entity_class_uri',
'fieldable' => FALSE,
'bundles' => array(
  'field_projects_details' => array( //field collection machine name.
    'label' => t('Projects Details  '),

I have also created a basic form to be shown as fields in the field collection. But nothing shows up.

  • Update: If I add an UI for the entity form the form appears on the page. But not on the field collection. – Malabya Tewari Mar 4 '15 at 6:36
  • If I understand you right, it sounds like you may be a little confused about what a field collection is. It's a fieldable entity in itself. You can't use it to assemble fields from other entities. – Alfred Armstrong Mar 4 '15 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.