Problem/Motivation

Deprecated function errors on Akamai config form page:

Deprecated function: Creation of dynamic property Drupal\akamai\Form\ConfigForm::$keyProvider is deprecated in Drupal\akamai\Form\ConfigForm->__construct() (line 56 of modules/contrib/akamai/src/Form/ConfigForm.php).

Deprecated function: Creation of dynamic property Drupal\akamai\Form\ConfigForm::$moduleHandler is deprecated in Drupal\akamai\Form\ConfigForm->__construct() (line 58 of modules/contrib/akamai/src/Form/ConfigForm.php).

Steps to reproduce

  1. Install the akamai module on a site using PHP 8.2.
  2. Visit /admin/config/akamai/config.
  3. Note the errors in the message region.

Screenshot of error

Proposed resolution

Declare the $keyProvider and $moduleHandler properties.

CommentFileSizeAuthor
#4 Screenshot from 2023-09-06 22-10-30.png338.17 KBnielsonm

Issue fork akamai-3385705

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nielsonm created an issue. See original summary.

benjifisher’s picture

Issue summary: View changes
Status: Active » Needs work

I am working with @nielsonm on a project using this module.

I requested some changes on the MR, so I am setting the status to NW.

I am not sure that the PHP version is relevant, but it might be. So I am adding it to the issue summary.

nielsonm’s picture

Issue summary: View changes
StatusFileSize
new338.17 KB
nielsonm’s picture

Status: Needs work » Needs review

Refactored.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the MR, and it looks good.

I tested (using PHP 8.2) and the error message does not show up.

In short, RTBC.

benjifisher’s picture

Issue summary: View changes
Issue tags: +PHP 8.2

I confirmed my guess: dynamic properties are deprecated in PHP 8.2, so this issue is related to that version.

moshe weitzman made their first commit to this issue’s fork.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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