Dynamic properties are deprecated in PHP 8.2

Created on 15 November 2023, 8 months ago
Updated 18 February 2024, 4 months ago

Problem/Motivation

In PHP 8.2, dynamic properties are deprecated. At least one class in FacetAPI does not declare all the properties that can be created on its instances.

Steps to reproduce

  1. Install the latest versions of FacetAPI and its dependencies on a Drupal 7 site running on PHP 8.2. Panopoly distro works for this.
  2. If not using Panopoly, configure a Search API results page and add some facets.
  3. Create some content and perform a Search API search using keywords in the content.
  4. Note this message in the logs:

Deprecated function: Creation of dynamic property FacetapiWidgetLinks::$sorts is deprecated in FacetapiWidget->sortFacet() (line 291 of /facetapi/plugins/facetapi/widget.inc).

Proposed resolution

Add the annotation to allow dynamic properties to the class. Another solution would be to declare all the properties in the class.

Remaining tasks

Patch and test.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cboyden

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024