NULL Count Error if no 'Managed Not Used' Files

Created on 6 March 2023, over 1 year ago
Updated 21 November 2023, about 1 year ago

Problem/Motivation

Error encountered at /admin/reports/auditfiles/managednotused

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 142 of modules/contrib/auditfiles/src/Form/AuditFilesManagedNotUsedForm.php).

Steps to reproduce

No 'Managed Not Used' files in website. Running 9.5.3 on PHP 8.1

Form had previously worked, until all relevant files had been removed from website, leaving the number of items as NULL.

Proposed resolution

Rework of auditfiles/src/Form/AuditFilesManagedNotUsedForm.php to test for NULL values in $rows and handle generation of form at buildListForm()

Error starts at https://git.drupalcode.org/project/auditfiles/-/blob/4.0.x/src/Form/Audi...

๐Ÿ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom robcarr Perthshire, Scotland

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