0

I have added an Entity Reference field to a Commerce : Product Type that uses the Inline Entity Form widget. The reference is to the Bookable Unit Type bundle that is created by the Rooms (more specifically, the Rooms Unit module which comes with Rooms).

I have attempted to add the following to function inline_entity_form_entity_info_alter(&$entity_info)

$entity_info['rooms_unit_type']['inline entity form'] = array(
  'controller' => 'CommerceLineItemInlineEntityFormController',
);

The entity reference form never shows when creating new or editing a product. If I use the autocomplete widget, I am able to select an entity (although that does me no good).

Thanks for any help.

  • There is no need to alter the code of a module when any module can implement hooks. Are you sure there is a room_unit_type entity? I would bet that is a content type, aka an entity bundle. – kiamlaluno May 8 '15 at 3:13
  • @kiamlaluno, I'm only altering the code to figure out what's going on. If it's an improvement that can be made with Rooms, and I can fix it, I'll submit a proper patch; alternatively, I would use hook_entity_info_alter in a custom module. Hmm, I'm not sure about the second question. room_unit_type is defined in hook_entity_info within the Rooms module. My goal here is to create new room_unit_type's while adding new products. – Chris Rockwell May 8 '15 at 3:21

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.