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

/course/editcategory.php can produce a fatal error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Administration, Navigation
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      If a user has a role that gives them enough permissions to see the Add and edit category buttons on a category page, when they try to use the page it can produce a Fatal error similar to:

      Fatal error: Call to a member function get() on a non-object in /var/www/html/course/editcategory.php on line 139

      How to reproduce:

      • Create a role that can be assigned at the Category level
      • Give the role the following two capabilities: moodle/category:manage and moodle/site:manageblocks (these seem to be the miminum permissions required to enable editing on Categories)
      • Enrol a user to this role on a category
      • Login to this page as the user, and turn editing on.
      • Click on either the 'Edit this category' or 'Add a sub-category' button. the error will now be generated.

      The error looks as though it will not occur only if a user can see the Site Administration -> Courses -> Add/edit courses node in the Settings block.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rajeshtaneja Rajesh Taneja
              Reporter:
              nmagill Neill Magill
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: