Moodle
  1. Moodle
  2. MDL-24708

Can't create activities in Moodle 2 running MySQL

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Environment:
      MySQL, Apache, Linux, Moodle 2.0 RC1 (Build: 20100921)
    • Database:
      MySQL
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Whenever I try and create a label, quiz or database I would get this error :-

      Error writing to database

      More information about this error

      Debug info: Field 'delay' doesn't have a default value
      INSERT INTO mdl_course_modules (course,module,instance,visible,groupmode,groupingid,groupmembersonly,added) VALUES(?,?,?,?,?,?,?,?)
      [array (
      0 => '2',
      1 => 25,
      2 => 0,
      3 => '1',
      4 => 0,
      5 => 0,
      6 => 0,
      7 => 1287358452,
      )]
      Stack trace:
      line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 816 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 858 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 2502 of /course/lib.php: call to mysqli_native_moodle_database->insert_record()
      line 397 of /course/modedit.php: call to add_course_module()

      Default value of delay is NULL, but doesn't like it for some reason.

        Gliffy Diagrams

          Activity

          Hide
          Tim Lock added a comment -

          This is a workaround to make it work.

          Show
          Tim Lock added a comment - This is a workaround to make it work.
          Hide
          Tim Lock added a comment -

          Doesn't seem to make a difference with version: 2.0 RC1 (Build: 20101017)

          Show
          Tim Lock added a comment - Doesn't seem to make a difference with version: 2.0 RC1 (Build: 20101017)
          Hide
          Petr Skoda added a comment -

          Hello,
          there is no 'delay' field in standard course_modules table. I suppose this is upgraded site with some custom tweaks, right? Did you ever change db tables in moodle manually? Did you install any plugin or patch that changes the standard DB tables?

          Petr

          Show
          Petr Skoda added a comment - Hello, there is no 'delay' field in standard course_modules table. I suppose this is upgraded site with some custom tweaks, right? Did you ever change db tables in moodle manually? Did you install any plugin or patch that changes the standard DB tables? Petr
          Hide
          Tim Lock added a comment -

          Hi Peta,

          I will look into this further, but don't understand the reason why the field has a default value (NULL) but fails through Moodle 2 DDL and not via mysql client.

          Regards,
          Tim

          Show
          Tim Lock added a comment - Hi Peta, I will look into this further, but don't understand the reason why the field has a default value (NULL) but fails through Moodle 2 DDL and not via mysql client. Regards, Tim
          Hide
          Petr Skoda added a comment -

          Please note it is strongly discouraged to modify standard moodle tables, this is the reason why - your extra db field is causing problems and you will have to solve it yourself, sorry.

          Show
          Petr Skoda added a comment - Please note it is strongly discouraged to modify standard moodle tables, this is the reason why - your extra db field is causing problems and you will have to solve it yourself, sorry.

            People

            • Assignee:
              Petr Skoda
              Reporter:
              Tim Lock
              Tester:
              Nobody
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: