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

Disabled functionality checks occur later than necessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.4, 2.7.1
    • Fix Version/s: 2.6.5, 2.7.2
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide

      With the site setting "enablenotes" on...

      Go into a course, select participants and select a user. In the navigation block select "notes" below that user.

      Add a note then edit that note. Save the edit URL.

      Find and save the delete URL but don't actually delete the note.

      Turn off "enablenotes". Accessing the saved URLs should result in a message saying "Notes are disabled, sorry."

      Similarly turn "enableblogs" on and off and check that you are locked out of your user blog or able to add and edit blog posts as appropriate.

      Show
      With the site setting "enablenotes" on... Go into a course, select participants and select a user. In the navigation block select "notes" below that user. Add a note then edit that note. Save the edit URL. Find and save the delete URL but don't actually delete the note. Turn off "enablenotes". Accessing the saved URLs should result in a message saying "Notes are disabled, sorry." Similarly turn "enableblogs" on and off and check that you are locked out of your user blog or able to add and edit blog posts as appropriate.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-46218_disabled2
    • Story Points:
      5
    • Sprint:
      FRONTEND Sprint 13

      Description

      While scouting around I noticed that /notes/edit.php and /notes/delete.php both include this check...

      if (empty($CFG->enablenotes)) {
          print_error('notesdisabled', 'notes');
      }
      

      but it occurs quite a way down the file after the $PAGE is set up, the user is loaded, the course is loaded and capability checks are performed. The check could be done much earlier to save us some cycles.

      There are likely to be other places where this is also true so have a look around.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              andyjdavis Andrew Davis
              Reporter:
              andyjdavis Andrew Davis
              Peer reviewer:
              Petr Skoda
              Integrator:
              Dan Poltawski
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Sep/14