• Resolved knittingand

    (@knittingand)


    The following has shown up in my error logs.

    mod_fcgid: stderr: PHP Warning: count(): Parameter must be an array or an object that implements Countable in website-address/plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 81, referer: a page from my website

    Is there any way I can fix it?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I got the same issue and the following is just my attempt at a fix so use at your own risk:

    On PHP7.2+ it should suffice to change:
    /framework/events/subjects/subject.subject.php LINE: 70

    from
    return isset($this->definition[$name]) ? $this->definition[$name] : NULL;

    to
    return isset($this->definition[$name]) ? $this->definition[$name] : [];

    At least I get no errors doing this.
    Hope this helps. Kind regards
    Chris

    Thanks @stchris. I was seeing a flood of these messages in our debug.log file:

    [18-Jan-2019 13:01:49 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/holycowom/public_html/wp-content/plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 81
    [18-Jan-2019 13:01:49 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/holycowom/public_html/wp-content/plugins/css-javascript-toolbox/framework/events/subjects/hook.subject.php on line 82

    Your tweak stopped the flood. ?? I hope this fix makes it into the official code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP warning’ is closed to new replies.