Moodle
  1. Moodle
  2. MDL-25397

Fatal error: Call to undefined function can_edit_in_category() in /var/www/moodle/lib/navigationlib.php on line 3501

    Details

    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      1142

      Description

      Hello,

      with debug enabled, I see the message "Fatal error: Call to undefined function can_edit_in_category() in /var/www/moodle/lib/navigationlib.php on line 3501" when I try to access any category cohort...

      It happens for a few days now, I have been using (and updating) Moodle 2.0 for since Preview 1...

      I manually deleted two entries in mdl_enrol table because I could unenroll a cohort from a course.

      What could I do and is it a new bug ? Thanks.

        Issue Links

          Activity

          Hide
          Philippe Siwinski added a comment -

          It is a bug which also occurs with the latest Moodle 2 release.

          I am not a PHP coder but I quick fixed the problem adding the code below in /lib/navigationlib.php line 3497, in the load_category_settings() function.

          require_once($CFG->dirroot.'/course/lib.php');

          Thanks for fixing.

          Show
          Philippe Siwinski added a comment - It is a bug which also occurs with the latest Moodle 2 release. I am not a PHP coder but I quick fixed the problem adding the code below in /lib/navigationlib.php line 3497, in the load_category_settings() function. require_once($CFG->dirroot.'/course/lib.php'); Thanks for fixing.
          Show
          Sam Hemelryk added a comment - Patch available at https://github.com/samhemelryk/moodle/commit/96a7059848e99701e7b685846963b1676809aba7
          Hide
          Sam Hemelryk added a comment -

          I've commit the fix for this now.
          We now check the capabilities rather than using can_edit_in_category.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - I've commit the fix for this now. We now check the capabilities rather than using can_edit_in_category. Cheers Sam

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: