[D7] Warning: count(): Parameter must be an array or an object that implements Countable

Created on 22 September 2020, over 4 years ago
Updated 2 April 2024, 9 months ago

Problem/Motivation

Using the watchdog_prune module 7.x-1.2 on Drupal 7.73 with PHP 7.3 produces PHP errors with the count() function.

Steps to reproduce

Install the watchdog_prune module 7.x-1.2 on a Drupal 7.73 installation with PHP 7.3. Force run the watchdog_prune_cron and then check the Recent log messages.

Proposed resolution

Add logic to check if the $watchdog_types and $prune_type_list variables exist as an array. The is_countable() function is only available in PHP 7.3+ and isn't an option for sites using a previous version.

πŸ› Bug report
Status

Closed: won't fix

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Zevarix Phoenix, Arizona

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