php 8.2 copatibility issue ResponseText: TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass

Created on 6 March 2024, 3 months ago

Problem/Motivation

doing export of taxonomy
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=92537&op=do_nojs&op=do StatusText: Service unavailable (with message) ResponseText: TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass given in taxonomy_csv_term_export() (line 566 of /modules/taxonomy_csv/export/taxonomy_csv.export.api.inc).

Steps to reproduce

upgrade to php8.2 --> do export

Proposed resolution

quick fix explicate cast
works for us but its treating a symptom, i did not run through all te code.
line 536 replace
if (count($term)) {
with
if (count((array)$term)) {

To do

create patch and pull request

πŸ› Bug report
Status

Needs work

Version

5.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium ikeigenwijs

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