title: In Drupal, is it not possible to have fields associated to entities that do not have bundles?
body: <p>I have created an entity via custom module. This entity does not have any bundle and it gets created perfectly fine. entity_get_info says it is not necessary to have bundles.</p>
  
  <p>Next, I create a field for entity reference using field_create_field and that works fine too. Now, when i want to associate this field as an instance to my custom entity and when I call field_create_instance (without specifying bundle), I get the error saying: </p>
  
  <blockquote>
    <p>drupal FieldException: Attempt to create an instance of field without a bundle</p>
  </blockquote>
  
  <p>I go on to see that bundle is a required field in field_config_instance .. I tried to specify bundle as the same name as entity but that did not work for me either. Actually, it did create an instance but on the entity add/edit form when I do a field_attach_form, I get another error:</p>
  
  <blockquote>
    <p>Notice: Undefined index: target_bundles in EntityReferenceHandler_base->buildEntityFieldQuery() (line 174 of /Applications/MAMP/htdocs/MYPROJECT/sites/all/modules/entityreference/handler/base.inc).</p>
  </blockquote>
  
  <p>Any help will be highly appreciated. </p>