Support » Plugin: Sensei LMS » PHP error

  • Resolved SpartakusMd



    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 1 month, 1 week ago by SpartakusMd.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Giannis Karagiannis


    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.


    Plugin Author Donna Peplinskie


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

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.