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

Questionnaire module needs compliance with Strict Standards

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: Module: Questionnaire
    • Labels:
      None
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE

      Description

      With full-on debugging Questionnaire module yields Strict Standards errors as follows:

      1. Strict Standards: Creating default object from empty value in [...]/mod/questionnaire/view.php on line 23
      Should presumably now read:

      if (!isset($SESSION->questionnaire)) $SESSION->questionnaire = new stdClass();
      $SESSION->questionnaire->current_tab = 'view';

      2. Strict Standards: Creating default object from empty value in [...]/mod/questionnaire/questiontypes/questiontypes.class.php on line 205
      Perhaps get_choices function should now read:

      function get_choices() {
      global $DB;

      $this->choices = array();
      if ($choices = $DB->get_records('questionnaire_quest_choice', array('question_id' => $this->id), 'id ASC')) {
      foreach ($choices as $choice)

      { $this->choices[$choice->id] = new stdClass(); $this->choices[$choice->id]->content = $choice->content; $this->choices[$choice->id]->value = $choice->value; }

      }
      }

      3. Strict Standards: Redefining already defined constructor for class questionnaire_question in [...]/mod/questionnaire/questiontypes/questiontypes.class.php on line 196

      Likely the earlier constructor "function questionnaire_question" should now be renamed __construct, as PHP 5.3 is required anyway, and the "fake" constructor removed.

      Regards,
      John

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rezeau Joseph Rézeau
              Reporter:
              jwhite10 John White
              Participants:
              Component watchers:
              Mike Churchward
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jul/12