TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count()

Created on 20 December 2022, almost 2 years ago
Updated 25 January 2023, over 1 year ago

Problem/Motivation

There is an issue when trying to run an export of the taxonomy term list. I tried to just do an export of a taxonomy term and received an error page with the attached.

TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count() (line 92 of /var/www/html/web/modules/contrib/term_csv_export_import/src/Controller/ExportController.php)

Steps to reproduce

Using PHP Version 8.0.24
Using Drupal 9.4.8.

1. Install module
2. Setup taxonomy vocabulary with a list of terms in a hierarchy
3. Go into the Configuration -> Term CSV Export/Import -> Term CSV Export -> Attempt to export new term

Proposed resolution

I'll put a quick patch together and attach in a later comment

πŸ› Bug report
Status

Fixed

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024