Wednesday 9 October 2019

D8 custom entity reference field not working.

Drupal 8 custom entity reference field not working. 


On our site we've added a field that links to an Entity with the Entity Reference functionality.

When using is I just get a spinning circle and it never resolves.


The issue I had was that in the Schema of my custom Entity I had the 'label' set up incorrectly.


The file to change was in

my_custom_entity
     -- config
           -- schema
                   -- company_entity_type.schema.yml


company.company_entity_type.*:  type:  my_custom_entity  label: 'Type config'  mapping:    id:      type: string      label: 'ID'    label:      type: label      label: 'Label'    uuid:      type: string
Change this too .
company.company_entity_type.*:
type: my_custom_entity label: 'Type config' mapping: id: type: string label: 'ID' label: type: title label: 'Title' uuid: type: string