• Resolved SpartakusMd

    (@spartakusmd)


    Hello,

    It seems there is an issue. When a user doesn’t complete a lesson quiz, this error from bellow shows up. But when a user completes the lesson quiz, this error does NOT appear.

    Warning: count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/woothemes-sensei/plugins/sensei-lms/includes/class-sensei-question.php on line 1075.

    Strange fact is that count() is used and inside that if, there is an is_array() check on that same field.

    Please revise the checks.

    • This topic was modified 5 years, 1 month ago by SpartakusMd.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Giannis

    (@gikaragia)

    Hello @spartakusmd,

    thank you for submitting this. PHP’s count function throws a warning when you supply it a non-countable variable in version 7.2 and afterwards. However it will still return 1 (unless the input is NULL). So in pre-7.2 PHP it would make sense to write something like that and then check if the variable is an actual array.

    In any case we will look into refactoring this to not throw a warning.

    Thanks,
    Giannis

    • This reply was modified 5 years, 1 month ago by Giannis.
    Plugin Author Donna Peplinskie (a11n)

    (@donnapep)

    Marking as resolved as this was fixed in Sensei LMS 2.4.0.

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