Return empty array in bat_event_get_types

Created on 24 November 2023, about 1 year ago
Updated 26 November 2023, about 1 year ago

The bat_event_get_types function, in bat/modules/bat_event/bat_event.module return an empty array, when i think it was to return the types.

Original code:

function bat_event_get_types($type_name = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityTypeManager()->getStorage('bat_event_type')->resetCache();
  }

  $types = EventType::loadMultiple();

  if (isset($type_name) && isset($types[$type_name])) {
    return $types[$type_name];
  }
  return [];

}

The most problable code:

function bat_event_get_types($type_name = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityTypeManager()->getStorage('bat_event_type')->resetCache();
  }

  $types = EventType::loadMultiple();

  if (isset($type_name) && isset($types[$type_name])) {
    return $types[$type_name];
  }
  return $types;

}

Without this modificationthe BatEventUiEventTypeForm form return an empty select.

πŸ› Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain Carlitus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024