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

"$PAGE->context was not set" error when accessing to policy/viewall.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Privacy
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Login as admin
      2. Go to "Site administration / Privacy and policies / Manage policies"
      3. Create a new and active policy for all users
      4. Make sure "Debug messages" are enabled for developers and "Display debug messages" are checked. (Or if using MDK, make sure to run "mdk run mindev")

      Testing instructions

      1. Access to http://[YOUR_MOODLE_SITE]/admin/tool/policy/viewall.php]
        • CHECK no error appears when loading this page
      Show
      Setup Login as admin Go to " Site administration / Privacy and policies / Manage policies " Create a new and active policy for all users Make sure "Debug messages" are enabled for developers and "Display debug messages" are checked. (Or if using MDK, make sure to run " mdk run mindev ") Testing instructions Access to http://[YOUR_MOODLE_SITE]/admin/tool/policy/viewall.php ] CHECK no error appears when loading this page
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-62162-master

      Description

      Juan has discovered the following while adding support to the tool_policy for the mobile app. When accessing to /admin/tool/policy/viewall.php page, the following error is displayed:

      Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result
      line 493 of /lib/pagelib.php: call to debugging()
       line 1544 of /lib/pagelib.php: call to moodle_page->magic_get_context()
       line 677 of /lib/pagelib.php: call to moodle_page->initialise_theme_and_output()
       line 864 of /lib/pagelib.php: call to moodle_page->magic_get_theme()
       line 161 of /admin/tool/policy/classes/api.php: call to moodle_page->get_renderer()
       line 57 of /admin/tool/policy/classes/api.php: call to tool_policy\api::list_policies()
       line 73 of /admin/tool/policy/classes/output/page_viewalldoc.php: call to tool_policy\api::list_current_versions()
       line 57 of /admin/tool/policy/classes/output/page_viewalldoc.php: call to tool_policy\output\page_viewalldoc->prepare_policies()
       line 37 of /admin/tool/policy/viewall.php: call to tool_policy\output\page_viewalldoc->__construct()
      

       

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18