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

Book module is not able to upgrade itself

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1. Create blank Moodle 2.3.x
      2. Create a course and book module
      3. Manually remove the associated course module record
      4. Upgrade to Moodle 2.5.x
      5. Verify upgrade completes and shows a warning like:
      "Course module not found, skipping: Book"

      Show
      1. Create blank Moodle 2.3.x 2. Create a course and book module 3. Manually remove the associated course module record 4. Upgrade to Moodle 2.5.x 5. Verify upgrade completes and shows a warning like: "Course module not found, skipping: Book"
    • Workaround:
      Hide

      Remove orphanned book entries:

      select b.id as bookid from mdl_book b left join mdl_course_modules cm on b.id = cm.instance and cm.module in (select id from mdl_modules where name='book') where cm.id is null order by b.id;

      Show
      Remove orphanned book entries: select b.id as bookid from mdl_book b left join mdl_course_modules cm on b.id = cm.instance and cm.module in (select id from mdl_modules where name='book') where cm.id is null order by b.id;
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      mdl36506-master

      Description

      I am trying to upgrade moodle from 2.3.2+ to 2.3.3 and I am blocked with this upgrade book problem. I think, this is database related problem, because we use book module since moodle 1.5. I am not alone with this problem (there is the same post in book forum)

      Debug info: SELECT id,course FROM

      {course_modules}

      WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      Stack trace:

      line 1335 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1311 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6644 of /lib/accesslib.php: call to moodle_database->get_record()
      line 117 of /mod/book/db/upgradelib.php: call to context_module::instance()
      line 169 of /mod/book/db/upgrade.php: call to mod_book_migrate_all_areas()
      line 627 of /lib/upgradelib.php: call to xmldb_book_upgrade()
      line 358 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1524 of /lib/upgradelib.php: call to upgrade_plugins()
      line 329 of /admin/index.php: call to upgrade_noncore()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tlock Tim Lock
              Reporter:
              petko81 Peter Svec
              Peer reviewer:
              Ankit Agarwal
              Integrator:
              David Monllaó
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              David Jones, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/May/15