Entity Reference explicitly excludes entities that extend ConfigEntityBase from being used. A couple of things:

  • It should not exclude ConfigEntityBase, but ConfigEntityInterface, as not all configuration entities may extend the base class.
  • The code comments in entity_reference_field_settings_form() say the workaround is because EFQ does not work on config entities, #1853856: Document that ConfigEntityBase and ConfigStorageController are tightly coupled, and #1846454: Add Entity query to Config entities. However, as chx explained to me, this limitation is simply because entity reference cannot yet properly link to either IDs or machine names, as the DB columns to store references have to be of a particular type (int/string), and casting values during joins does not perform well.
CommentFileSizeAuthor
#3 drupal_1963392_01.patch1.18 KBXano
#1 drupal_1963392_00.patch1.18 KBXano
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xano’s picture

Status: Active » Needs review
FileSize
1.18 KB

Status: Needs review » Needs work

The last submitted patch, drupal_1963392_00.patch, failed testing.

Xano’s picture

Status: Needs work » Needs review
FileSize
1.18 KB

Changed in_array() to !in_array().

Also, @chx suggested the following to make config entity references possible. This may be useful for a follow-up issue:

i am going to sleep but one wonders whether it'd be possible to change the entity reference schema upon field create and thus make it possible to refer config entities
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

It's unfortunate that we have to change a @todo with another one, but this is still an improvement for the moment.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed e16a424 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Xano’s picture

Assigned: Xano » Unassigned