Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal_1963392_01.patch | 1.18 KB | Xano |
#1 | drupal_1963392_00.patch | 1.18 KB | Xano |
Comments
Comment #1
XanoComment #3
XanoChanged 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:
Comment #4
amateescu CreditAttribution: amateescu commentedIt's unfortunate that we have to change a @todo with another one, but this is still an improvement for the moment.
Comment #5
alexpottCommitted e16a424 and pushed to 8.x. Thanks!
Comment #7
Xano