Warning: Undefined array key

Created on 9 April 2024, 9 months ago
Updated 10 April 2024, 9 months ago

Problem/Motivation

Seeing a lot of Undefined array key warnings in Office Hours. Appears to be related to https://www.drupal.org/project/office_hours/issues/3439370 🐛 Warning: Undefined array key 0 in OfficeHoursItemList->addOfficeHours() Fixed

php.WARNING: Warning: Undefined array key 1713016800 in Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList->addOfficeHours() (line 237 of /data/app/modules/contrib/office_hours/src/OfficeHoursFormatterTrait.php)
#0 /data/app/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /data/app/modules/contrib/office_hours/src/OfficeHoursFormatterTrait.php(237): _drupal_error_handler()
#2 /data/app/modules/contrib/office_hours/src/OfficeHoursFormatterTrait.php(113): Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList->addOfficeHours()
#3 /data/app/modules/contrib/office_hours/src/Plugin/Field/FieldType/OfficeHoursItemList.php(111): Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList->getFieldRows()
#4 /data/app/modules/contrib/office_hours/src/Plugin/Field/FieldFormatter/OfficeHoursFormatterDefault.php(54): Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList->getRows()
#5 /data/app/core/lib/Drupal/Core/Field/FormatterBase.php(91): Drupal\office_hours\Plugin\Field\FieldFormatter\OfficeHoursFormatterDefault->viewElements()
#6 ...

Steps to reproduce

Currently unknown. Using Office Hours in a View seems to be enough to produce these warnings.

Proposed resolution

Find and fix the bug.

Remaining tasks

Fix the bug.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Closed: duplicate

Version

1.17

Component

Code

Created by

🇦🇺Australia geoffreyr

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024