Problem/Motivation
Bookable Calendar uses a deprecated function, which throws a warning:
Deprecated function: Creation of dynamic property Drupal\bookable_calendar\Notification::$messenger is deprecated in Drupal\bookable_calendar\Notification->__construct() (line 75 of modules/contrib/bookable_calendar/src/Notification.php).
Steps to reproduce
While running PHP 8.2 on Drupal 10.2.x, create a new booking. This results in the warning.
Proposed resolution
Per this PHP doc, creation of dynamic properties is deprecated and need updating the code to be compatible with PHP 8.2
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
abhishek_gupta1 commentedComment #3
abhishek_gupta1 commented@tijsdeboeck, I have fixed the issue and created Patch. Please kindly review it.
Comment #4
martin74 commentedGot the same issue , Patch did not help , changed
bookable_calendar\Notification->__construct() (line 79
79 = $this->connection = $connection;
Comment #5
dineshkumarbollu commentedGetting same error patch#3 creates new WSOD error
TypeError: Drupal\bookable_calendar\Notification::__construct(): Argument #3 ($token) must be of type Drupal\Core\Utility\Token, Drupal\Core\Messenger\Messenger given, called in /var/www/html/diet/vb1020/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\bookable_calendar\Notification->__construct() (line 65 of modules/contrib/bookable_calendar/src/Notification.php).Comment #6
dineshkumarbollu commentedComment #7
martin74 commentednope
Deprecated function: Creation of dynamic property Drupal\bookable_calendar\Notification::$messenger is deprecated in Drupal\bookable_calendar\Notification->__construct() (line 75
Comment #8
marcolam commentedI applied the #6 patch and no more error message as in #1.
Thanks!
Env: Drupal 10.1.8,PHP 8.2.18, bookable calendar 2.2.11
Comment #10
josh.fabeanPatch is applied in latest 2.2.x and will be 2.2.12, thanks!
Comment #11
josh.fabean