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

tijsdeboeck created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new1.07 KB

@tijsdeboeck, I have fixed the issue and created Patch. Please kindly review it.

martin74’s picture

Got the same issue , Patch did not help , changed

bookable_calendar\Notification->__construct() (line 79

79 = $this->connection = $connection;

dineshkumarbollu’s picture

Status: Needs review » Needs work

Getting 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).

dineshkumarbollu’s picture

Status: Needs work » Needs review
StatusFileSize
new878 bytes
martin74’s picture

nope

Deprecated function: Creation of dynamic property Drupal\bookable_calendar\Notification::$messenger is deprecated in Drupal\bookable_calendar\Notification->__construct() (line 75

marcolam’s picture

I 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

  • josh.fabean committed e1f10e0f on 2.2.x
    Issue #3422474 by dineshkumarbollu, abhishek_gupta1, martin74,...
josh.fabean’s picture

Patch is applied in latest 2.2.x and will be 2.2.12, thanks!

josh.fabean’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.