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

Max Length of Question name not set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.14, 2.0, 2.1, 2.2
    • Fix Version/s: 1.9.14, 2.0, 2.1, 2.2
    • Component/s: Module: Questionnaire
    • Labels:
      None
    • Workaround:
      Hide

      fix: change

      $mform->addElement('text', 'name', get_string('optionalname', 'questionnaire'), array('size'=>'25'));

      to

      $mform->addElement('text', 'name', get_string('optionalname', 'questionnaire'), array('size'=>'30', 'maxlength'=>'30'));

      Show
      fix: change $mform->addElement('text', 'name', get_string('optionalname', 'questionnaire'), array('size'=>'25')); to $mform->addElement('text', 'name', get_string('optionalname', 'questionnaire'), array('size'=>'30', 'maxlength'=>'30'));
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      questionnaire_question table field name Type is varchar(30) but maxlength of that field is not set in questions_form.php which results in error writing to database if user enters a question name string > 30

      see http://moodle.org/mod/forum/discuss.php?d=188770

        Attachments

          Activity

            People

            Assignee:
            rezeau Joseph Rézeau
            Reporter:
            rezeau Joseph Rézeau
            Participants:
            Component watchers:
            Mike Churchward
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10