Visiting the page admin/config/people/httpbl i have a log warning, possible related to the php 7.3 version I use

Warning: count(): Parameter must be an array or an object that implements Countable in httpbl_admin_settings_validate() (line 197 of /home/drupal-7/sites/all/modules/contrib/httpbl/httpbl.admin.inc).

Issue fork httpbl-3117532

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anonymous’s picture

cmseasy created an issue. See original summary.

mariquita’s picture

I'm receiving this error, too, but using php version 7.2.

mattshoaf’s picture

I was seeing this as well, on that line `!count(form_get_errors())`, count is calling a function, in other drupal code that uses that they've changed it to `!form_get_errors()`. If you remove count and the corresponding parenthesis it will remove the error, this module hasn't been updated since 2012, so I doubt we'll see another update any time soon.

fgm’s picture

Issue tags: +PHP 7.4

The error happens because form_get_errors() returns an inconsistent result type: an array when errors exist, but null when no errors exist, so count() cannot be used: empty() should be used instead.

fgm’s picture

Status: Active » Needs review

Submitted PR

Anonymous’s picture

@fgm, thanks for the patch, my log warning is gone now.