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

Upgrade process fails if pagetype null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.2.11
    • 2.0, 2.2, 2.2.10
    • Installation
    • MySQL
    • MOODLE_20_STABLE, MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide

      1/ install Moodle 1.9
      2/ create courses with many blocks
      3/ enable blocks support in activities (theme settings) and add some blocks to lesson for example
      4/ use DB editor to delete source course records and lesson records
      5/ execute upgrade to 2.2.x
      6/ verify the upgrade completes without block errors and that the blocks are upgraded properly (including activity blocks)

      Show
      1/ install Moodle 1.9 2/ create courses with many blocks 3/ enable blocks support in activities (theme settings) and add some blocks to lesson for example 4/ use DB editor to delete source course records and lesson records 5/ execute upgrade to 2.2.x 6/ verify the upgrade completes without block errors and that the blocks are upgraded properly (including activity blocks)

      Hi Petr,

      Experienced this issue when upgrading a site from 1.9.10 -> 2.0 RC1.

      Debug info: Column 'pagetype' cannot be null

      INSERT INTO mdl_block_positions (blockinstanceid, contextid, pagetype, subpage, visible, region, weight)
      SELECT id, contextid,
      CASE WHEN pagetypepattern = 'course-view-*' THEN
      (SELECT CONCAT('course-view-', format)
      FROM mdl_course
      JOIN mdl_context ON mdl_course.id = mdl_context.instanceid
      WHERE mdl_context.id = contextid)
      ELSE pagetypepattern END,
      CASE WHEN subpagepattern IS NULL THEN ''
      ELSE subpagepattern END,
      0, defaultregion, defaultweight
      FROM mdl_block_instances WHERE visible = 0 AND pagetypepattern <> 'admin-*'
      [array (
      )]

      Stack trace:

      • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 645 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 1858 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->execute()
      • line 1309 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      • line 264 of /admin/index.php: call to upgrade_core()

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

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.