I was having a hard time associating my entity reference field to my custom entity which did not have a bundle. Went on to find that the filtering done in the function "buildEntityFieldQuery" in the file "handler/base.inc" filtered using target_bundles (line 174 - line 176) and therefore when creating the field, I had to specify

<?php
  'settings' => array(
    'target_type' => 'MY_TARGET_ENTITY',
    'handler_settings' => array('target_bundles' => NULL),
  ),
?>

and the same in my instance too and then it worked fine. The complete flow is shared as a blog : http://www.innoraft.com/blog/use-entity-reference-your-custom-entities-w...

Comments

charlie-s’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-rc5
Status: Closed (fixed) » Active

I'm also experiencing this. Why do we need to have bundles defined?

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)