Skip to content
Snippets Groups Projects
Commit e717ad0e authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3402450: Remove duplicate key from ComplexWeekWidget

parent 570e063e
No related branches found
No related tags found
No related merge requests found
Pipeline #52962 passed with warnings with stages
in 2 minutes and 5 seconds
......@@ -40,7 +40,8 @@ class OfficeHoursComplexWeekWidget extends OfficeHoursSeasonWidget {
/** @var \Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList $items */
/** @var \Drupal\office_hours\Plugin\Field\FieldWidget\OfficeHoursWeekWidget $widget */
$field_type = 'office_hours';
$element[$field_type][0] = parent::formElement($items, $delta, $element, $form, $form_state);
$id = 0;
$element[$field_type][$id] = parent::formElement($items, $delta, $element, $form, $form_state);
$items->filterEmptyItems();
// Then, add a List Widget for the Exception days.
......@@ -49,9 +50,9 @@ class OfficeHoursComplexWeekWidget extends OfficeHoursSeasonWidget {
$plugin_id = 'office_hours_exceptions_only';
$field_definition = $items->getFieldDefinition($field_type);
$id = 0;
$widget = $this->getOfficeHoursPlugin('widget', $plugin_id, $field_definition);
$id++;
$widget_form = $widget->form($items, $form, $form_state);
// @todo #3335549 Decide to use complete form or only ['widget'] part.
$element[$field_type][$id] = $widget_form['widget'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment