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

Session variable can be empty when accessed causing PHP warning

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6.3
    • 2.6.1
    • Module: Questionnaire
    • None
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE

      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?

            rezeau Joseph Rézeau
            jenny-gray Jenny Gray (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.