PHP warning when there are no results.

Created on 31 January 2023, almost 2 years ago
Updated 12 May 2023, over 1 year ago

Problem/Motivation

In the event of there being no results, the render method creates a warning due to a missing property.

Warning: Undefined property: Drupal\views_ical\Plugin\views\style\IcalWizard::$vTimezone in Drupal\views_ical\Plugin\views\style\IcalWizard->render() (line 252 of modules/contrib/views_ical/src/Plugin/views/style/IcalWizard.php).

Being able to create empty calendars is a requirement to removing entries that have been created with webcal:// links.

Steps to reproduce

Create a feed with no results in the view.

Proposed resolution

Add a check.

    if (isset($this->vTimezone)) {
      $this->calendar->setTimezone($this->vTimezone);
    }
πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom very_random_man

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

Comments & Activities

Production build 0.71.5 2024