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

Negative limitnum parameter detected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.7.2
    • Assignment
    • None
    • MOODLE_27_STABLE

      When accessing the Assignment grading page, the following debugging message is shown when Assignments per page option is set to All.: Negative limitnum parameter detected: -1, did you pass the correct arguments?

      Initial report of this issue can be found at https://moodle.org/mod/forum/discuss.php?d=264251

      I've tested this in v2.6.3 and v2.7.2+ and this issue seems to be introduced from v2.7. There are no issues with v2.6.

      This debug message comes from normalise_limit_from_num() in /lib/dml/moodle_database.php, which is introduced from v2.7.

      The value of $limitnum passed from the assign module is '-1' of type string so the following check on $limitnum fails:

      if ($limitnum === null || $limitnum === '' || $limitnum === -1) {
          $limitnum = 0;
      }
      

      Either the value passed from the assign module needs to be an integer or the above check needs to first convert $limitnum to integer.

      In v2.6, the value of $limitnum was casted to int in get_records_sql() in /lib/dml/mysqli_native_moodle_database.php as shown:

      $limitnum  = (int)$limitnum;

            Unassigned Unassigned
            rjnl Rajneel Totaram
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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