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

Workshop - Error: Could not insert workshop assessment - no default value for the generalcomment

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.9.2
    • Fix Version/s: 1.9.7
    • Component/s: Workshop
    • Labels:
      None
    • Environment:
    • Database:
      MySQL, PostgreSQL
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      When trying to assess as teacher a submission to a workshop, an error is found:
      Field 'generalcomment' doesn't have a default value

      INSERT INTO mdl_workshop_assessments ( WORKSHOPID, SUBMISSIONID, USERID, TIMECREATED, TIMEGRADED, TIMEAGREED, GRADE, RESUBMISSION ) VALUES ( 1, 1, 3, 1197759000, 0, 0, -1, 0 )

      Could not insert workshop assessment!

      ?Solution here: http://moodle.org/mod/forum/discuss.php?d=52978&parent=261469

        Gliffy Diagrams

          Activity

          Hide
          apiedras Antonio Piedras Morente added a comment -

          The error still continues.
          We have a Moodle's installation with this features: 1.9 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1

          We have solved this bug modifying generalcomment and teachercomment fields of the mdl_workshop_assessments table, altering these fields to put a default value, in this case an empty string.

          Bye

          Show
          apiedras Antonio Piedras Morente added a comment - The error still continues. We have a Moodle's installation with this features: 1.9 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1 We have solved this bug modifying generalcomment and teachercomment fields of the mdl_workshop_assessments table, altering these fields to put a default value, in this case an empty string. Bye
          Hide
          ashleyholman Ashley Holman added a comment -

          This problem still happens on the latest MOODLE_19_STABLE, under postgres.

          Attached is a patch to the mod/workshop/locallib.php file which fixes this.

          Show
          ashleyholman Ashley Holman added a comment - This problem still happens on the latest MOODLE_19_STABLE, under postgres. Attached is a patch to the mod/workshop/locallib.php file which fixes this.
          Hide
          skmoodle ska added a comment -

          We have the same problem with v1.8.3+

          In phase 3 of workshop there are NULL constraint errors in the Postgres log.

          There are other places, too, where the problem hits. Looking at the database spec, any field has a default value, but generalcomment and teachercomment.

          I therefore added:
          ALTER TABLE mdl_workshop_assessments alter column generalcomment set default '';
          ALTER TABLE mdl_workshop_assessments alter column teachercomment set default '';

          Since then, the workshop works for us.

          Show
          skmoodle ska added a comment - We have the same problem with v1.8.3+ In phase 3 of workshop there are NULL constraint errors in the Postgres log. There are other places, too, where the problem hits. Looking at the database spec, any field has a default value, but generalcomment and teachercomment. I therefore added: ALTER TABLE mdl_workshop_assessments alter column generalcomment set default ''; ALTER TABLE mdl_workshop_assessments alter column teachercomment set default ''; Since then, the workshop works for us.
          Hide
          mudrd8mz David Mudrak added a comment -

          Fixed in CVS. The patch was applied.

          Show
          mudrd8mz David Mudrak added a comment - Fixed in CVS. The patch was applied.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Nov/09