Fix Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock under PHP 8.2+

Created on 28 December 2023, 11 months ago
Updated 16 April 2024, 7 months ago

Problem/Motivation

The creation of dynamic properties is deprecated in PHP 8.2

Steps to reproduce

Deprecated function: Creation of dynamic property Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock::$requestStack is deprecated in Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock->__construct() (line 164 of modules/contrib/varbase_media_header/src/Plugin/Block/VarbaseMediaHeaderBlock.php).

Deprecated function: Creation of dynamic property Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock::$blockManager is deprecated in Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock->__construct() (line 166 of modules/contrib/varbase_media_header/src/Plugin/Block/VarbaseMediaHeaderBlock.php).

Deprecated function: Creation of dynamic property 
Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock::$renderer is deprecated in Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock->__construct() (line 167 of modules/contrib/varbase_media_header/src/Plugin/Block/VarbaseMediaHeaderBlock.php).

Deprecated function: Creation of dynamic property Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock::$entityFieldManager is deprecated in Drupal\varbase_media_header\Plugin\Block\VarbaseMediaHeaderBlock->__construct() (line 168 of modules/contrib/varbase_media_header/src/Plugin/Block/VarbaseMediaHeaderBlock.php).

Proposed resolution

Add the protected properties in VarbaseMediaHeaderBlock.php

Remaining tasks

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3411198 by Ahmad Khader : Fixed Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock under PHP 8.2+
🐛 Bug report
Status

Fixed

Version

10.0

Component

Code

Created by

🇯🇴Jordan Ahmad Khader

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

Comments & Activities

Production build 0.71.5 2024