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

Typo in accesslib causes performance optimization to be skipped (backport of MDL-43049)

XMLWordPrintable

    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • Hide

      1/ Check all unit tests (particular the accesslib tests) pass.
      2/ Verify cron processing works - mod_forum subscriptions is a nice example
      3/ Run behat tests

      Show
      1/ Check all unit tests (particular the accesslib tests) pass. 2/ Verify cron processing works - mod_forum subscriptions is a nice example 3/ Run behat tests

      There appears to be a typo in get_user_accessdata() in lib/accesslib.php, L1116-1122:

          if (!empty($USER->acces['rdef']) and empty($ACCESSLIB_PRIVATE->rolepermissions)) {
              // share rdef from USER session with rolepermissions cache in order to conserve memory
              foreach($USER->acces['rdef'] as $k=>$v) {
                  $ACCESSLIB_PRIVATE->rolepermissions[$k] =& $USER->acces['rdef'][$k];
              }
              $ACCESSLIB_PRIVATE->accessdatabyuser[$USER->id] = $USER->acces;
          }
      

      I believe it should be $USER->access, not $USER->acces (all four references in this block).

      Because of the first condition the effect of this typo is that this block of code above is never run. While not necessary for the function to work it is there to save memory so assuming that the code is otherwise correct fixing the typo should reduce memory consumption.

            mr-russ Russell Smith (Inactive)
            poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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