Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-9423

Error writing to database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3
    • Module: Questionnaire
    • None
    • 2022092202
    • MOODLE_403_STABLE

      In the Questionnaire, go to feedback. Use feedback per section. Create a label with a long name. 

      Error will popup 'Error writing to database'. No further information, unless you will turn on debugging and see the following:

       
      Debug info: Data too long for column 'sectionlabel' at row 1
      INSERT INTO mdl_questionnaire_fb_sections (surveyid,section,scorecalculation,sectionlabel,sectionheading,sectionheadingformat) VALUES(?,?,?,?,?,?)
      [array (
      0 => '2',
      1 => 3,
      2 => 'a:0:{}',
      3 => 'Zet doelstellingen om in activiteiten voor een plan',
      4 => '',
      5 => '1',
      )]
      Error code: dmlwriteexception
      Stack trace: * line 497 of /lib/dml/moodle_database.php: dml_write_exception thrown

      • line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
      • line 1482 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
      • line 1528 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      • line 101 of /mod/questionnaire/classes/feedback/section.php: call to mysqli_native_moodle_database->insert_record()
      • line 149 of /mod/questionnaire/fbsections.php: call to mod_questionnaire\feedback\section::new_section()
        --------

      So the label name has a maximum number of characters, but the error doesn't show it and the form field allows past the maximum.

      My idea would be to have a maximum number of characters in the form field 'label' and thus avoiding the database write error.

            mchurch Mike Churchward
            elodelta Richard van Iwaarden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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