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

Long forum name causes fatal DB error with rating/grades enabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.7, 3.8.4, 3.9.1
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      If you have a forum with a name over ~240 characters, and try to turn on ratings or whole forum grades, you will get a fatal Error writing to database (ERROR: value too long for type character varying(255)).

      This is because, while activities and grade items both have a 255 char length limit, the forum prepends '{{Rating grade for }}' or '{{Whole forum grade for }}' before the forum name when creating the grade item.

      The issue is in mod/forum/lib.php::forum_grade_item_update().

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            emerrill Eric Merrill
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: