From 22f559b7fac494fde750ae8663e8c0375424a177 Mon Sep 17 00:00:00 2001 From: Steve Taylor Date: Fri, 10 Jan 2020 15:38:01 -0800 Subject: [PATCH] Add field_digital_heritage_items to our exclusion Otherwise if there is only one kind of content on a site the field select2 control will not populate. --- .../modules/contrib/entityreference/entityreference.module | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entityreference.module b/entityreference.module index 4acea881..e4d06abd 100644 --- a/entityreference.module +++ b/entityreference.module @@ -851,8 +851,9 @@ function entityreference_options_list($field, $instance = NULL, $entity_type = N // Mukurtu specific patch. // By default Entity Reference does not include the entity type if there is only a single type. // ma_base_theme_field_widget_form_alter requires the entity type for field_related_content. - if (isset($field['field_name']) && $field['field_name'] == 'field_related_content') { - // Return options with entity type always for field_related_content. + $special_fields = array('field_digital_heritage_items', 'field_related_content'); + if (isset($field['field_name']) && in_array($field['field_name'], $special_fields)) { + // Return options with entity type always for special fields. return $return; } -- 2.19.0.windows.1