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

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-10.0.0-rc2, varbase-9.0.18, varbase_media_header-9.0.10, Varbase 9.1.1, varbase_media_header-9.1.2, varbase_media_header-10.0.0-beta4

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+

Comments

Ahmad Khader created an issue. See original summary.

ahmad khader’s picture

ahmad khader’s picture

For varbase 9

rajab natshah’s picture

Title: Fixes Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock is deprecated » Fix Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock
rajab natshah’s picture

Issue tags: +PHP 8.2, +PHP 8.3

rajab natshah’s picture

Title: Fix Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock » Fix Deprecated function: Creation of dynamic property in VarbaseMediaHeaderBlock under PHP 8.2+
Issue summary: View changes
Issue tags: +varbase-9.0.18, +varbase_media_header-9.0.10, +varbase-9.1.1, +varbase_media_header-9.1.2, +varbase-10.0.0-rc2, +varbase_media_header-10.0.0-beta4

Thank you, Ahmad, for reporting and patching.

rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
Issue tags: -varbase-10.0.0-rc2 +varbase-10.0.0
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-9.0.18

rajab natshah’s picture

Issue summary: View changes

✅ Released Varbase 9.1.1

Status: Fixed » Closed (fixed)

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

rajab natshah’s picture

Issue summary: View changes
Issue tags: -varbase-10.0.0 +varbase-10.0.0-rc2
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-10.0.0-rc2