Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-60789

Workshop/Submissions - Form doesn't check title field for maxlength 255

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.6, 3.3.3, 3.4
    • 3.3.4, 3.4.1
    • Workshop
    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-60789-master
    • Hide

      Set up

      1. Login as teacher
      2. Create a workshop, configure it and move to the "Submission phase"

       

      Testing instructions

      1. Login as student
      2. Access to the workshop
      3. Try to create a submission with a title longer than 255 characters and save changes
        • CHECK no "Writing database error" appears
        • CHECK submission is not saved because an "Maximum of 255 characters" message appears below title
      4. Modify the title with less than 255 characters and save changes
        • CHECK submission is sent correctly
      Show
      Set up Login as teacher Create a workshop, configure it and move to the "Submission phase"   Testing instructions Login as student Access to the workshop Try to create a submission with a title longer than 255 characters and save changes CHECK no "Writing database error" appears CHECK submission is not saved because an "Maximum of 255 characters" message appears below title Modify the title with less than 255 characters and save changes CHECK submission is sent correctly

    Description

      When creating a new submission, the user is able to enter titles more than 255 characters long.

      When he does this, he gets only a simple "Database error occurred".

       

      See [https://github.com/moodle/moodle/blob/master/mod/workshop/submission_form.php|submission form code].

      Fix: Add a simple rule, like this:

      $mform->addRule('title', null, 'maxlength', 255, 'client');

      Attachments

        Activity

          People

            sarjona Sara Arjona (@sarjona)
            poggenpohlda Daniel Poggenpohl
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            David Monllaó David Monllaó
            David Monllaó David Monllaó
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/Jan/18