Problem/Motivation

Shortly after introducing the RequirementsRecapSensorPlugin a new version of PHP was released that deprecated the dynamic creation of properties.

Now we're seeing these errors in watchdog:

Deprecated function: Creation of dynamic property Drupal\monitoring\Result\SensorResult::$requirements is deprecated in Drupal\monitoring\Plugin\monitoring\SensorPlugin\RequirementsRecapSensorPlugin->runSensor() (line 69 of /app/web/modules/contrib/monitoring/src/Plugin/monitoring/SensorPlugin/RequirementsRecapSensorPlugin.php)

Proposed resolution

It would be nicer, if we could set the data \Drupal\monitoring\Result\SensorResult::setResultData but the method is protected, so I'm proposing to create a property on the RequirementsRecapSensorPlugin itself.

Alternatively we could drop the additional info from the resultVerbose but I still find it helpful to quickly see the requirements errors and warnings.

CommentFileSizeAuthor
#5 42.patch2.35 KBfago

Issue fork monitoring-3546021

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

useernamee created an issue. See original summary.

useernamee’s picture

Title: Deprecated function: Creation of dynamic property Drupal\monitoring\Result\SensorResult::$requirements is deprecated in Drupal\monitoring\Plugin\monitoring\SensorPlugin\RequirementsRecapSensorPlugin » Deprecated function: Creation of dynamic property SensorResult::$requirements is deprecated in RequirementsRecapSensorPlugin

useernamee’s picture

Status: Active » Needs review
fago’s picture

StatusFileSize
new2.35 KB

MR seems all good. Uploading a patch for use with composer-patches also + giving it a test now.

fago’s picture

Status: Needs review » Reviewed & tested by the community

The MR correctly addresses the issue also.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Merged.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • berdir committed 589350e2 on 8.x-1.x authored by useernamee
    fix: #3546021 Deprecated function: Creation of dynamic property...

Status: Fixed » Closed (fixed)

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