[PHP 8.2] Deprecated function: Creation of dynamic property Drupal\google_calendar_service\Controller\CalendarImportController::$entityManager

Created on 7 December 2023, 7 months ago

Problem/Motivation

I am getting this warning when trying to import calendar events at /calendar/all/import

Deprecated function: Creation of dynamic property Drupal\google_calendar_service\Controller\CalendarImportController::$entityManager is deprecated in Drupal\google_calendar_service\Controller\CalendarImportController->__construct() (line 60 of modules/contrib/google_calendar_service/src/Controller/CalendarImportController.php).

Drupal\google_calendar_service\Controller\CalendarImportController->__construct(Object, Object, Object, Object) (Line: 67)
Drupal\google_calendar_service\Controller\CalendarImportController::create(Object) (Line: 28)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\google_calendar_service\Controller\CalendarImportController') (Line: 116)
Drupal\Core\Controller\ControllerResolver->createController('\Drupal\google_calendar_service\Controller\CalendarImportController::import') (Line: 68)
Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\Drupal\google_calendar_service\Controller\CalendarImportController::import', '/calendar/all/import') (Line: 84)
Drupal\Core\Controller\ControllerResolver->getController(Object) (Line: 165)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

- Install this module on a D10 instance on PHP 8.2, add a new calendar and set the google keys, then go to /calendar/all/import and try to import the latest calendar events

Proposed resolution

- The property $entityManager needs to be declared explicity.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada danrod

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024