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

Improve error message when $PAGE->context is not set

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.1
    • Component/s: Libraries
    • Labels:
      None
    • Testing Instructions:
      Hide

      Create a page that includes config.php, then calls $OUTPUT->header() without calling $PAGE->set_context() or require_login() first. The page will display a warning then display the content.

      Show
      Create a page that includes config.php, then calls $OUTPUT->header() without calling $PAGE->set_context() or require_login() first. The page will display a warning then display the content.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
      pagelib_single

      Description

      The error message displayed when $OUTPUT->header() is called before $PAGE->set_context() currently doesn't explain what the problem is or how to fix it.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Tim Hunt
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Glenn Ansley
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              1/Jul/11