0

I have a number of existing entity reference fields in my site. The key one is a taxonomy reference field called field_search_terms. I would like to add this field to the Document media type. However when I go to manage fields for the media type my existing fields are not available.

It looks like I need to create a new field and any search that mixes content and media will need to have two filters.

Why is this limitation in place? Is there an issue I can follow to learn more?

enter image description here

1
  • 1
    Fields can only be re-used in the same entity type - maybe your existing field_search_terms is on a different entity type?
    – Clive
    Apr 28 '20 at 12:54
0

I found the resources I was looking for with help from a comment by Clive:

A field can only be used on the same entity type. There is an open issue for this in the queue. According to the issue and my recollection this is a change from Drupal 7. If so it feels like a major regression.

The documentation is also incorrect at the time of this writing.

1
  • It's no longer possible because in D7 a field got a generic table in the database and the entity type was a field within the database. Within D8 a field gets its own table in the database but the table name is prefixed with the entity type. There are probably lots of valid reasons for this such the config management system requiring it to be like this, with the trade-off of being unable to reuse a field across entity types and you now just have to remake the field for each entity type
    – Leigh
    Apr 28 '20 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.