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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.6, 3.3.3, 3.4
    • Fix Version/s: 3.3.4, 3.4.1
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull 3.4 Branch:
    • Pull Master Branch:
      MDL-60789-master

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18