PHP 8.2 Deprecated function: Automatic conversion of false to array is deprecated in apachesolr_has_searched() (line 1101 /apachesolr/apachesolr.module)

Created on 25 September 2024, 2 months ago

Problem/Motivation

I got into this PHP deprecation notice when running a D7 on a new instance with PHP 8.2 installed:

Deprecated function: Automatic conversion of false to array is deprecated in apachesolr_has_searched() (line 1101 /apachesolr/apachesolr.module)

Steps to reproduce

Proposed resolution

At line 1101, check if $searched is FALSE, if so, caste to ARRAY or assign [] to it:

function apachesolr_has_searched($env_id, $searched = NULL) {
  $_searched  = &drupal_static(__FUNCTION__, FALSE);
  if (is_bool($searched)) {
    $_searched[$env_id] = ($searched == FALSE) ? [] : $searched;
  }
  ....

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada danrod Ottawa

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024