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

Capability check error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.2.1
    • 2.2
    • Questions
    • Any
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide

      Replace next function:

       public function having_cap($cap) {
              $contextswithcap = array();
              foreach ($this->allcontexts as $context) {
                  if (has_capability($cap, $context)) {
                      $contextswithcap[] = $context;
                  }
              }
              return $contextswithcap;
          }
       

      with:

       public function having_cap($cap) {
              $contextswithcap = array();
              foreach ($this->allcontexts as $context) {
                  if ($context!=NULL && has_capability($cap, $context)) {
                      $contextswithcap[] = $context;
                  }
              }
              return $contextswithcap;
          }
       

      Show
      Replace next function: public function having_cap($cap) { $contextswithcap = array(); foreach ($this->allcontexts as $context) { if (has_capability($cap, $context)) { $contextswithcap[] = $context; } } return $contextswithcap; }   with: public function having_cap($cap) { $contextswithcap = array(); foreach ($this->allcontexts as $context) { if ($context!=NULL && has_capability($cap, $context)) { $contextswithcap[] = $context; } } return $contextswithcap; }  
    • Hide

      We need to verify that this code change does not cause any regressions.

      Logged in as a teacher, create and edit some questions in the question bank, and move them between categories, and make sure there are no errors.

      Show
      We need to verify that this code change does not cause any regressions. Logged in as a teacher, create and edit some questions in the question bank, and move them between categories, and make sure there are no errors.

      After upgrade I get "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error" when try to view a course.

            timhunt Tim Hunt
            rodries rodrigo
            Sam Hemelryk Sam Hemelryk
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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