PHP 8.2 - Fix deprecated dynamic properties

Created on 29 April 2024, 7 months ago
Updated 28 June 2024, 5 months ago

Problem/Motivation

Under PHP 8.2, the warning message Deprecated function: Creation of dynamic property WorkflowTransitionForm::$entity_type is deprecated in WorkflowTransitionForm->__construct() is raised.

Steps to reproduce

Enable the workflow module on a Drupal 7.x site running under PHP 8.2 or later.

Proposed resolution

Declare $entity_type as a protected property in the class definition.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bernman

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

Comments & Activities

  • Issue created by @bernman
  • Status changed to Needs review 7 months ago
  • πŸ‡³πŸ‡±Netherlands johnv

    Please try the attached fix.

  • πŸ‡ΊπŸ‡ΈUnited States bernman

    Thank you for the patch, it is just as I would have expected it to be but for some reason, that I do not yet understand, the patch does not apply cleanly. I have added it to my makefile (invoked using drush si) as follows:

    projects[workflow][subdir] = contrib
    projects[workflow][version] = 2.x
    projects[workflow][patch][] = https://www.drupal.org/files/issues/2024-04-30/workflow_3444207-2_dynamic-property-WorkflowTransitionForm.patch
    

    Which results in:
    Unable to patch workflow with workflow_3444207-2_dynamic-property-WorkflowTransitionForm.patch.

  • πŸ‡΅πŸ‡­Philippines ambot112

    Updated the patch.

  • Status changed to RTBC 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bernman

    Patch #4 applies cleanly. Thank you!

Production build 0.71.5 2024