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

Can't create activities in Moodle 2 running MySQL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

          Attachments

            Activity

            tlock Tim Lock created issue -
            Hide
            tlock Tim Lock added a comment -

            This is a workaround to make it work.

            Show
            tlock Tim Lock added a comment - This is a workaround to make it work.
            tlock Tim Lock made changes -
            Field Original Value New Value
            Attachment MDL-24708-Cant-create-activities-in-Moodle-2-running-MySQL.patch [ 21846 ]
            Hide
            tlock Tim Lock added a comment -

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

            Show
            tlock Tim Lock added a comment - Doesn't seem to make a difference with version: 2.0 RC1 (Build: 20101017)
            skodak Petr Skoda made changes -
            Assignee moodle.com [ moodle.com ] Petr ?koda (skodak) [ skodak ]
            Hide
            skodak 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
            skodak 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
            skodak Petr Skoda made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Cannot Reproduce [ 5 ]
            Hide
            tlock 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
            tlock 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
            skodak 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
            skodak 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.
            dougiamas Martin Dougiamas made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            QA Assignee nobody
            dougiamas Martin Dougiamas made changes -
            Workflow jira [ 39578 ] MDL Workflow [ 65870 ]
            dougiamas Martin Dougiamas made changes -
            Workflow MDL Workflow [ 65870 ] MDL Full Workflow [ 95221 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: