Problem/Motivation
I have successfully added new columns (sub-field) to a custom field using the provided PHP code in the documentation, but when trying to add an entity_reference column I get this error
> [warning] Undefined array key "target_type" EntityReference.php:33
> [error] Field 'xxxx' references a target entity type '' which does not exist.
In my case the entity_reference is towards a taxonomy_term, I tried to add
'target_type' => 'taxonomy_term'
to the array of $options parameters but nothing changes.
What is the syntax to add an entity_reference column?
thanks
Issue fork custom_field-3462856
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
apmsooner commentedEntity reference is not currently supported but I'll work on it. Thanks for bringing to my attention.
Comment #3
apmsooner commentedComment #4
apmsooner commentedComment #6
apmsooner commentedComment #7
apmsooner commentedThe syntax is correct. The original code just wasn't accounting for it. You can try this now with the patch and as long as you have a valid entity type as the target_type, it should process. There is validation in place to ensure a valid target_type is included when data type is entity_reference and will provide messaging in the exception if not.
Comment #8
apmsooner commentedComment #10
apmsooner commented