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

Long forum post subject causes error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.8.7, 1.9.3
    • 1.9, 1.9.1, 1.9.2
    • Forum
    • None
    • Moodle 1.9.2, Postgres, PHP 4.x
    • Any
    • MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      The DB field for forum_posts->subject is varchar(255), but the web form does not enforce this. If a longer subject is entered, a 'Could not add your post due to an unknown error' is thrown when on Postgres, under MySQL the subject just gets truncated by the DB, with no knowledge of the user.

      Solution is to add this at line 118 of mod/forum/post_form.php:
      $mform->addRule('subject', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');

      Same problem found with the forum name. Should add this at like 17 of mod/forum/mod_forum.php:
      $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');

            emerrill Eric Merrill
            emerrill Eric Merrill
            Petr Skoda Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.