- Issue created by @Majdi
- Merge request !7Fix for Deprecated dynamic property creation in UpdateAvailabilityForm. β (Open) created by Majdi
When navigating to the node availability path (node/{nid}/availability) after making a node type bookable and creating a node of that type, the following PHP deprecation warnings are observed:
Deprecated function: Creation of dynamic property Drupal\bee\Form\UpdateAvailabilityForm::$nodetypeStorage is deprecated in Drupal\bee\Form\UpdateAvailabilityForm->__construct() (line 45 of modules/contrib/bee/src/Form/UpdateAvailabilityForm.php).
Deprecated function: Creation of dynamic property Drupal\bee\Form\UpdateAvailabilityForm::$nodeStorage is deprecated in Drupal\bee\Form\UpdateAvailabilityForm->__construct() (line 46 of modules/contrib/bee/src/Form/UpdateAvailabilityForm.php).
This occurs because properties $nodetypeStorage and $nodeStorage are being dynamically created in the constructor of UpdateAvailabilityForm without being declared within the class definition.
See https://www.php.net/manual/en/class.allowdynamicproperties.php
Modify the UpdateAvailabilityForm class to declare these properties explicitly at the beginning of the class.
Active
3.0
Code