Moodle
  1. Moodle
  2. MDL-35254

Error writing to database when developing books on Moodle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.3.1
    • Fix Version/s: None
    • Component/s: Book
    • Labels:
      None
    • Affected Branches:
      MOODLE_23_STABLE
    • Rank:
      43905

      Description

      We are able to create new books however when we add a new page - it gives us the "error writing to database" screen and hitting continue then bumps us back to main screen. The new page however is there when we go back into the book on the course webpage. As you can imagine this is very frustrating and time consuming. We appear to be able to make edits to the page and these save ok and the data is held.

      The other issue involves making edits to the book settings page - originally we thought it might have just be affecting the book templates we had created before the change to 2.3. Unfortunately it appears to affect all (new and old). If you go back and make any changes to the settings page - you get the "error writing to database" screen when you save.

        Issue Links

          Activity

          Hide
          Sheila Owen added a comment -

          We are having the same problem when making any changes in books.

          This is the Error log:

          Error writing to database

          More information about this error
          Debug info: Unknown column 'revision' in 'field list'
          UPDATE mdl_book SET revision = ? WHERE id = ?
          [array (
          0 => 1,
          1 => '32',
          )]
          Error code: dmlwriteexception
          Stack trace:

          line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 1126 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1529 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
          line 75 of /mod/book/delete.php: call to moodle_database->set_field()

          Show
          Sheila Owen added a comment - We are having the same problem when making any changes in books. This is the Error log: — Error writing to database More information about this error Debug info: Unknown column 'revision' in 'field list' UPDATE mdl_book SET revision = ? WHERE id = ? [array ( 0 => 1, 1 => '32', )] Error code: dmlwriteexception Stack trace: line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1126 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1529 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select() line 75 of /mod/book/delete.php: call to moodle_database->set_field() —
          Hide
          Drew Mortensen added a comment -

          Same problem here too. Running 2.3.1 (upgraded) on RHEL and Mysql. Almost identical error log.

          Debug info: Unknown column 'revision' in 'field list'
          UPDATE mdl_book SET revision = ? WHERE id = ?
          [array (
          0 => 1,
          1 => '11',
          )]
          Error code: dmlwriteexception
          Stack trace:

          line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 1126 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1529 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
          line 100 of /mod/book/edit.php: call to moodle_database->set_field()

          Output buffer: Notice: Undefined property: stdClass::$revision in /moodle/mod/book/edit.php on line 100 Notice: Undefined index: revision in /moodle/lib/dml/mysqli_native_moodle_database.php on line 1111

          Show
          Drew Mortensen added a comment - Same problem here too. Running 2.3.1 (upgraded) on RHEL and Mysql. Almost identical error log. Debug info: Unknown column 'revision' in 'field list' UPDATE mdl_book SET revision = ? WHERE id = ? [array ( 0 => 1, 1 => '11', )] Error code: dmlwriteexception Stack trace: line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1126 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1529 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select() line 100 of /mod/book/edit.php: call to moodle_database->set_field() Output buffer: Notice: Undefined property: stdClass::$revision in /moodle/mod/book/edit.php on line 100 Notice: Undefined index: revision in /moodle/lib/dml/mysqli_native_moodle_database.php on line 1111
          Hide
          Ankit Agarwal added a comment - - edited

          Hi guys,
          From what I can guess, you upgraded from 1.9 to 2.3 via 2.2? And your 1.9 install had book installed?
          If so MDL-35297 is a work in progress to fix that issue.
          Thanks

          Show
          Ankit Agarwal added a comment - - edited Hi guys, From what I can guess, you upgraded from 1.9 to 2.3 via 2.2? And your 1.9 install had book installed? If so MDL-35297 is a work in progress to fix that issue. Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi Ankit et all,

          yup I'm closing this as duplicate of MDL-35297, that I'm trying to sort out right now.

          Thanks for the report!

          Show
          Eloy Lafuente (stronk7) added a comment - Hi Ankit et all, yup I'm closing this as duplicate of MDL-35297 , that I'm trying to sort out right now. Thanks for the report!

            People

            • Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: