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

Undefined $buttons variable in admin/category.php when viewing admin pages as non-admin user

XMLWordPrintable

    • MOODLE_33_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-61513-master
    • Hide

      Note: Probably easier to test on Clean theme since the notice is being blocked by the header in the Boost theme.

      1. Login as an admin
      2. Set "Site administration / Development / Debugging": Debug messages to "ALL: Show all reasonable PHP debug messages"
      3. Go to "Site administration / Users / Permissions / Define roles"
      4. Click on "Add a new role" and define a role with the following settings:
        Short name nonadminsystemrole
        Custom full name Non-admin system role
        Role archetype None
        Context types where this role may be assigned System
        Capability "moodle/site:configview" (Allow)
          "report/performance:view" (Allow)

        and save by clicking "Create this role"

      5. Go to "Site administration / Users / Permissions / Assign system roles"
      6. Assign a user to the non-admin system role that you created.
      7. Login as that user.
      8. Go to "Site admnistration / Reports"
      9. Click on the "Reports" category link.
        • Confirm that you don't see the notice about the undefined variable.
      Show
      Note: Probably easier to test on Clean theme since the notice is being blocked by the header in the Boost theme. Login as an admin Set " Site administration / Development / Debugging ": Debug messages to "ALL: Show all reasonable PHP debug messages" Go to " Site administration / Users / Permissions / Define roles " Click on "Add a new role" and define a role with the following settings: Short name nonadminsystemrole Custom full name Non-admin system role Role archetype None Context types where this role may be assigned System Capability "moodle/site:configview" (Allow)   "report/performance:view" (Allow) and save by clicking "Create this role" Go to " Site administration / Users / Permissions / Assign system roles " Assign a user to the non-admin system role that you created. Login as that user. Go to " Site admnistration / Reports " Click on the " Reports " category link. Confirm that you don't see the notice about the undefined variable.

      To reproduce:

      1. Login as an admin
      2. Go to "Site administration / Users / Permissions / Define roles"
      3. Define a role with the following settings:
        Short name nonadminsystemrole
        Custom full name Non-admin system role
        Role archetype None
        Context types where this role may be assigned System
        Capability "moodle/site:configview" (Allow)
          "report/performance:view" (Allow)
      4. Go to "Site administration / Users / Permissions / Assign system roles"
      5. Assign a user to the non-admin system role that you created.
      6. Login as that user.
      7. Go to "Site admnistration / Reports"
      8. Click on the "Reports" category link.
        • You'll see the following:

          Notice: Undefined variable: buttons in /home/jun/moodles/gdpr/moodle/admin/category.php on line 132
          

        1. 1.PNG
          1.PNG
          40 kB
        2. MDL-61513-after.png
          MDL-61513-after.png
          133 kB
        3. MDL-61513-before.png
          MDL-61513-before.png
          203 kB

            jpataleta Jun Pataleta
            jpataleta Jun Pataleta
            Luca Bösch Luca Bösch
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 13 minutes
                13m

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