Commit 3da22715 authored by Nia Kathoni's avatar Nia Kathoni Committed by Daniel Cothran
Browse files

Issue #3273720 by nikathone: Follow up issue when selecting colors for entity reference

parent c42776ec
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ class BaseSettings extends FormElement {
    }

    $metadata = [
      'grouping_field_name' => $grouping_field_name,
      'grouping_field_name' => $grouping_field_info['field'],
      'selected_method' => $selected_method,
      'entity_type_id' => $entity_type_id,
    ];
@@ -1257,12 +1257,12 @@ class BaseSettings extends FormElement {
   *   The entity type id.
   */
  private static function getReferenceEntityTypeId($field_info, string $selection_method) {
    if (!$selection_method || empty($field_info['type']) || $field_info['type'] !== 'entity_reference_label' || empty($field_info['id'])) {
    if (!$selection_method || empty($field_info['type']) || $field_info['type'] !== 'entity_reference_label' || empty($field_info['field'])) {
      return '';
    }
    $table = Views::viewsData()->get($field_info['table']);
    $field_id = $field_info['id'];
    return $table[$field_id]['relationship']['entity type'] ?? '';
    $field_machine_name = $field_info['field'];
    return $table[$field_machine_name]['relationship']['entity type'] ?? '';
  }

  private static function buildColorsSelectionSubFormByEntities(array $element, array $metadata, EntityTypeManagerInterface $entity_type_manager) {