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

Whole foum grading causes DB error when forum name is more than 255 chars

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.5
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_38_STABLE

      Description

      Debug info: Data too long for column 'itemname' at row 1
      INSERT INTO mdl_grade_items (courseid,categoryid,itemname,itemtype,itemmodule,iteminstance,itemnumber,iteminfo,idnumber,calculation,gradetype,grademax,grademin,scaleid,outcomeid,gradepass,multfactor,plusfactor,aggregationcoef,aggregationcoef2,sortorder,display,decimals,locked,locktime,needsupdate,weightoverride,timecreated,timemodified,hidden) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
      [array (
      .......... itemname is set to the forum name which is more than 255 utf8 chars
      )]
      Error code: dmlwriteexception
      Stack trace:

      line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 1331 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1377 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 349 of /lib/grade/grade_object.php: call to mysqli_native_moodle_database->insert_record()
      line 497 of /lib/grade/grade_item.php: call to grade_object->insert()
      line 130 of /lib/gradelib.php: call to grade_item->insert()
      line 926 of /mod/forum/lib.php: call to grade_update()
      line 867 of /mod/forum/lib.php: call to forum_grade_item_update()
      line 208 of /mod/forum/lib.php: call to forum_update_grades()
      line 610 of /course/modlib.php: call to forum_update_instance()
      line 157 of /course/modedit.php: call to update_moduleinfo()

      EDIT: Also applies to using ratings
      EDIT: User is not able to use a name longer than 255 ascii chars, so this is an edge case.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            amanda.doughty Amanda Doughty
            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: