Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79186

Moodle Error on CRON Save

XMLWordPrintable

      Hi there,

       

      I experienced an issue while testing the task scheduling feature in Moodle. The error message I received was "Exception - count(): Argument #1 ($value) must be of type Countable|array, string given". I noticed that this error occurs when scheduling any cron task and any of the fields contain a value such as 0/12 or any integer/integer. This error happens on both the latest stable versions of Moodle, version 4.1 and 4.2, when running them on either PHP 8 or PHP 8.1. However, this error does not occur when using PHP 7.4.

       

      To reproduce the error, you can go to the /admin/tool/task/scheduledtasks.php page, select any task to edit, then enter an integer/integer value in any of the fields and save. This should fail on php 8 and php 8.1 but succeed on php 7.4.

       

      Let me know if you have any questions or need further assistance.

            pholden Paul Holden
            zee_n Zwivhuya Nthakheni
            Mohamed Shehata Mohamed Shehata
            Jake Dallimore Jake Dallimore
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 7 minutes
                2h 7m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.