Moodle
  1. Moodle
  2. MDL-23613

$PAGE->context accessed before it was known

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Files API, Filters
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      I have a clean install of the latest Moodle 2.0 Preview 4 (20100802).

      I have created a topics course.

      When I click "Filters" in the Settings Menu I see "Coding error detected, it must be fixed by a programmer: $PAGE->context accessed before it was known." with a stack trace of:

      • line 331 of /lib/pagelib.php: coding_exception thrown
      • line 585 of /lib/pagelib.php: call to moodle_page->magic_get_context()
      • line 1216 of /lib/weblib.php: call to moodle_page->__get()
      • line 3433 of /lib/accesslib.php: call to format_string()
      • line 47 of /filter/manage.php: call to print_context_name()

      When I attempt to do anything with the file manager, and click "Server Files" I get the same error.

      This is also happening at user/managetoken.php with stack trace:

      • line 331 of /lib/pagelib.php: coding_exception thrown
      • line 585 of /lib/pagelib.php: call to moodle_page->magic_get_context()
      • line 1216 of /lib/weblib.php: call to moodle_page->__get()
      • line 828 of /lib/pagelib.php: call to format_string()
      • line 30 of /user/managetoken.php: call to moodle_page->set_title()

      See attached images.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Petr Skoda added a comment -

            all Three places should be fixed now, thanks for the report!

            Show
            Petr Skoda added a comment - all Three places should be fixed now, thanks for the report!
            Hide
            Iver Johnson added a comment -

            Petr,

            After a CVS Update, I am still receiving this error in the File Browser. Pulled my logs for the trace:

            Default exception handler: Coding error detected, it must be fixed by a programmer: $PAGE->context accessed before it was known. Debug: \n* line 331 of /lib/pagelib.php: coding_exception thrown\n* line 585 of /lib/pagelib.php: call to moodle_page->magic_get_context()\n* line 1216 of /lib/weblib.php: call to moodle_page->__get()\n* line 231 of /lib/filebrowser/file_info_context_course.php: call to format_string()\n* line 83 of /repository/local/lib.php: call to file_info_context_course->get_visible_name()\n* line 143 of /repository/repository_ajax.php: call to repository_local->get_listing()\n, referer: http://localhost/moodle20/course/modedit.php?add=resource&type=&course=2&section=1&return=0

            The other two locations it works now. Thanks!

            Show
            Iver Johnson added a comment - Petr, After a CVS Update, I am still receiving this error in the File Browser. Pulled my logs for the trace: Default exception handler: Coding error detected, it must be fixed by a programmer: $PAGE->context accessed before it was known. Debug: \n* line 331 of /lib/pagelib.php: coding_exception thrown\n* line 585 of /lib/pagelib.php: call to moodle_page->magic_get_context()\n* line 1216 of /lib/weblib.php: call to moodle_page->__get()\n* line 231 of /lib/filebrowser/file_info_context_course.php: call to format_string()\n* line 83 of /repository/local/lib.php: call to file_info_context_course->get_visible_name()\n* line 143 of /repository/repository_ajax.php: call to repository_local->get_listing()\n, referer: http://localhost/moodle20/course/modedit.php?add=resource&type=&course=2&section=1&return=0 The other two locations it works now. Thanks!
            Hide
            Petr Skoda added a comment -

            one more fix added into file browser code, please test and reopen if necessary, thanks a lot!

            Show
            Petr Skoda added a comment - one more fix added into file browser code, please test and reopen if necessary, thanks a lot!
            Hide
            Chardelle Busch added a comment -

            FYI

            I also get this error when logging out without a sesskey-e.g. I have a login block with user info that includes a logout button-clicking that button gives the above error. I know that I used to be able to logout with a sesskey-is that no longer possible?

            Show
            Chardelle Busch added a comment - FYI I also get this error when logging out without a sesskey- e.g. I have a login block with user info that includes a logout button -clicking that button gives the above error. I know that I used to be able to logout with a sesskey-is that no longer possible?
            Hide
            Petr Skoda added a comment -

            Hello,
            all the PAGE->context issues on the /login/* pages should be finally fixed, Thank you for your reports.

            Petr Skoda

            Show
            Petr Skoda added a comment - Hello, all the PAGE->context issues on the /login/* pages should be finally fixed, Thank you for your reports. Petr Skoda

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: