Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-4856

Session variable can be empty when accessed causing PHP warning

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.3
    • Component/s: Module: Questionnaire
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE

      Description

      The $SESSION->questionnaire variable is used in many places without any check that it exists beforehand. This can throw errors when accessing a page through a bookmark for the first time in your browser session.

      For example:

      Log in on browser A, navigate to /mod/questionnaire/report.php

      Copy url to browser B

      • I got to the correct page but there was some warning code at the top:

      Warning: Creating default object from empty value in /vle/www_root/mod/questionnaire/report.php on line 107

      I think this affects new pages: fbsections, fbsettings, and settings as well as existing pages myreport, qsettings, questions, report and show_nonrespondents.

      I'm a bit worried about preview.php which overwrites any existing $SESSION->questionniare with new StdClass(). I don't think it should do that?

        Attachments

          Activity

            People

            • Assignee:
              rezeau Joseph Rézeau
              Reporter:
              jenny-gray Jenny Gray
              Participants:
              Component watchers:
              Mike Churchward
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14