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
    • Rank:
      8163

      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.

        Activity

        Tim Lock created issue -
        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.
        Tim Lock made changes -
        Field Original Value New Value
        Attachment MDL-24708-Cant-create-activities-in-Moodle-2-running-MySQL.patch [ 21846 ]
        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)
        Petr Škoda made changes -
        Assignee moodle.com [ moodle.com ] Petr ?koda (skodak) [ skodak ]
        Hide
        Petr Škoda 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 Škoda 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
        Petr Škoda made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        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 Škoda 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 Škoda 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.
        Martin Dougiamas made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        QA Assignee nobody
        Martin Dougiamas made changes -
        Workflow jira [ 39578 ] MDL Workflow [ 65870 ]
        Martin Dougiamas made changes -
        Workflow MDL Workflow [ 65870 ] MDL Full Workflow [ 95221 ]

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: