Creation of dynamic property Drupal\lightning_scheduler\Time::$_serviceId is deprecated

Created on 15 September 2023, about 1 year ago
Updated 15 July 2024, 4 months ago

Problem/Motivation

Installing the module on a PHP 8.2 site produces the persistent PHP notice error:
Deprecated function: Creation of dynamic property Drupal\lightning_scheduler\Time::$_serviceId is deprecated in Drupal\Component\DependencyInjection\Container->createService() (line 285 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Steps to reproduce

Install module on a site running PHP 8.2

Proposed resolution

This seems to be caused by an addition to the services.yml file used by the mode:

    # Workaround for serializing decorated services. Remove when either
    # https://www.drupal.org/project/drupal/issues/2896993 or
    # https://www.drupal.org/project/drupal/issues/2531564 are fixed.
    properties:
      _serviceId: datetime.time

Looking at both linked issues, they have both been resolved. Can the additional code now be removed?

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom MrDaleSmith

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

Comments & Activities

Production build 0.71.5 2024