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

Upgrade steps not followed by mdl_book in upgrade to 2.3

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.3
    • Component/s: Book, Installation
    • Labels:
    • Testing Instructions:
      Hide

      Requirements:

      • Enable debug developer & display errors.
      • This requires access to multiple git repositories and being able to switch branches by the tester.
      • Also, ideally, the ability to perform "site backups" (db & moodledata) is recommended to avoid the manual execution of the "preparing the initial status" section multiple times.

      Preparing the initial status:

      • Install MOODLE_19_STABLE site
      • Clone git://github.com/skodak/moodle-mod_book.git into the site mod/book dir
      • Checkout the MOODLE_19_STABLE branch of mod/book
      • Install mod/book.
      • There is one attached backup file (backup-book-mdl-35297.zip) containing:
      • 1 book activity with image in the intros (pink).
      • 2 chapters and 1 subchapter all them with images too (red, green, blue).
      • Restore, as admin, the backup file into the site, 2 times to new course and 2 times to existing course, so at the end you get at least 2 courses with 2 book activities each. The process ends ok and all the images are in place (the summary and the chapters ones).
      • Note: At this point probably it would be interesting to perform a site backup (database & moodledata) because the points executed until now must be repeated later for other combination of branches/versions.

      The "TESTs CHECK LIST"

      This is the list of things that must be tested at the end of each upgrade combination below:

      1. Edit the settings of any of the book activities.
      2. Without modifying anything, click and press "Save and return to course".
      3. TEST: No error happens and you are redirected to the course page normally.
      4. Visit the 4 books and verify that:
        1. TEST: Each book has 2 chapters and 1 subchapter.
        2. TEST: Each of the chapters/subchapters have one image (red, green, blue).
        3. TEST: The links of the images are served through pluginfile.php (aka they have been moved to proper book file area (mod_book/chapter).
        4. TEST: Manually going to the list of books in a course (http://MOODLEURL/mod/book/index.php?id=COURSEID) shows the intro for all book activities, each one with its "pink" image.
        5. TEST: The "pink" images are also being served through pluginfile.php with proper file area (mod_book/intro).
      5. TEST: Verify the following database columns exist with the detailed specs below:
        1. book->intro, of type text exists
        2. book->introformat, of type integer exists, not null
        3. book->revision, of type integer exists, not null
        4. book->disableprinting does not exist
        5. book->summary does not exist
        6. book_chapters->contentformat, of type integer exists, not null

      Testing 1.9 => 2.2 => 2.4 upgrade.

      • Prepare the initial status (manually or from site backup).
      • Checkout MOODLE_22_STABLE for the site.
      • Checkout MOODLE_20_STABLE for the mod/book.
      • Upgrade the site.
      • TEST: No error happens.
      • Delete the mod/book dir (better move it to your Desktop or wherever, you will need it again later).
      • Checkout master for the site.
      • Upgrade the site.
      • TEST: No error happens.
      • Verify the complete "TESTs CHECK LIST" above is passing.

      Testing 1.9 => 2.2 => 2.3 => 2.4 upgrade.

      • Prepare the initial status (manually or from site backup).
      • Checkout MOODLE_22_STABLE for the site.
      • Checkout MOODLE_20_STABLE for the mod/book.
      • Upgrade the site.
      • TEST: No error happens.
      • Delete the mod/book dir.
      • Checkout MOODLE_23_STABLE for the site.
      • Upgrade the site.
      • TEST: No error happens.
      • Verify the complete "TESTs CHECK LIST" above is passing.
      • Checkout master for the site.
      • Upgrade the site.
      • TEST: No error happens.
      • Verify the complete "TESTs CHECK LIST" above is passing.

      And that's all, I think that with these combinations tested we are ensuring that anybody installing 23_STABLE or later will be getting the mod_book upgraded properly. Of course, if you're interested into testing any other combination... you are welcome.

      Ciao

      Show
      Requirements: Enable debug developer & display errors. This requires access to multiple git repositories and being able to switch branches by the tester. Also, ideally, the ability to perform "site backups" (db & moodledata) is recommended to avoid the manual execution of the "preparing the initial status" section multiple times. Preparing the initial status: Install MOODLE_19_STABLE site Clone git://github.com/skodak/moodle-mod_book.git into the site mod/book dir Checkout the MOODLE_19_STABLE branch of mod/book Install mod/book. There is one attached backup file (backup-book-mdl-35297.zip) containing: 1 book activity with image in the intros (pink). 2 chapters and 1 subchapter all them with images too (red, green, blue). Restore, as admin, the backup file into the site, 2 times to new course and 2 times to existing course, so at the end you get at least 2 courses with 2 book activities each. The process ends ok and all the images are in place (the summary and the chapters ones). Note: At this point probably it would be interesting to perform a site backup (database & moodledata) because the points executed until now must be repeated later for other combination of branches/versions. The "TESTs CHECK LIST" This is the list of things that must be tested at the end of each upgrade combination below: Edit the settings of any of the book activities. Without modifying anything, click and press "Save and return to course". TEST: No error happens and you are redirected to the course page normally. Visit the 4 books and verify that: TEST: Each book has 2 chapters and 1 subchapter. TEST: Each of the chapters/subchapters have one image (red, green, blue). TEST: The links of the images are served through pluginfile.php (aka they have been moved to proper book file area (mod_book/chapter). TEST: Manually going to the list of books in a course ( http://MOODLEURL/mod/book/index.php?id=COURSEID ) shows the intro for all book activities, each one with its "pink" image. TEST: The "pink" images are also being served through pluginfile.php with proper file area (mod_book/intro). TEST: Verify the following database columns exist with the detailed specs below: book->intro, of type text exists book->introformat, of type integer exists, not null book->revision, of type integer exists, not null book->disableprinting does not exist book->summary does not exist book_chapters->contentformat, of type integer exists, not null Testing 1.9 => 2.2 => 2.4 upgrade. Prepare the initial status (manually or from site backup). Checkout MOODLE_22_STABLE for the site. Checkout MOODLE_20_STABLE for the mod/book. Upgrade the site. TEST: No error happens. Delete the mod/book dir (better move it to your Desktop or wherever, you will need it again later). Checkout master for the site. Upgrade the site. TEST: No error happens. Verify the complete "TESTs CHECK LIST" above is passing. Testing 1.9 => 2.2 => 2.3 => 2.4 upgrade. Prepare the initial status (manually or from site backup). Checkout MOODLE_22_STABLE for the site. Checkout MOODLE_20_STABLE for the mod/book. Upgrade the site. TEST: No error happens. Delete the mod/book dir. Checkout MOODLE_23_STABLE for the site. Upgrade the site. TEST: No error happens. Verify the complete "TESTs CHECK LIST" above is passing. Checkout master for the site. Upgrade the site. TEST: No error happens. Verify the complete "TESTs CHECK LIST" above is passing. And that's all, I think that with these combinations tested we are ensuring that anybody installing 23_STABLE or later will be getting the mod_book upgraded properly. Of course, if you're interested into testing any other combination... you are welcome. Ciao
    • Workaround:
      Hide

      Upgrade to the 2.1 version of the plugin after upgrading to Moodle 2.2 before upgrading to 2.3.

      Show
      Upgrade to the 2.1 version of the plugin after upgrading to Moodle 2.2 before upgrading to 2.3.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Site with Book installed prior to upgrading to Moodle 2.3 throw an error when adding or editing chapters. I compared my upgraded site to a fresh 2.3 and noticed the fresh install had the extra column. The error is:

      Debug info: Unknown column 'revision' in 'field list'
      UPDATE mdl_book SET revision = ? WHERE id = ?
      [array (
      0 => 1,
      1 => '50',
      )]
      Error code: dmlwriteexception
      Stack trace:
      
          line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 1207 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 /srv/www/htdocs/mod/book/edit.php on line 100 Notice: Undefined index: revision in /srv/www/htdocs/lib/dml/mysqli_native_moodle_database.php on line 1192
      

      I added the revision column manually to resolve the issue. Please see http://moodle.org/mod/forum/discuss.php?d=208436.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12