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

Questionnaire module needs compliance with Strict Standards

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.3
    • 2.3.1
    • Module: Questionnaire
    • None
    • MOODLE_23_STABLE
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:
                9/Jul/12