$collections["dates"] might not be set in viewSchedule()

Created on 10 June 2025, 3 days ago

Problem/Motivation

In viewSchedule() we have this:

    $collections = $this->dataProvider->getCollections($uprn);

if something went wrong with the retrieval of the data, this will be empty -- there is a check for that further down.

But before we get to that, if public holidays are enabled, there's an access of a property on the array -- which could be empty:

    if ($this->config->get('public_holidays')) {
      $publicHolidays = $this->publicHolidays->getPublicHolidays();
      foreach ($collections["dates"] as $key => $values) {

This will produce a warning.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024