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

Blocks flexpage upgrade breaks on postgres

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Blocks
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      I guess this works in mysql?:

      ERROR: value too long for type character varying(10)

      UPDATE mdl_block_instances SET defaultregion = $2 WHERE defaultregion = $1
      [array ( 0 => 'c', 1 => 'course-view-top', )]
      ? line 365 of /lib/dml/moodle_database.php: dml_write_exception thrown
      ? line 223 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      ? line 1008 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      ? line 1341 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->set_field_select()
      ? line 1815 of /lib/db/upgrade.php: call to moodle_database->set_field()
      ? line 1073 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      ? line 233 of /admin/index.php: call to upgrade_core()

      From code:
      $DB->set_field('block_instances', 'defaultregion', 'course-view-top', array('defaultregion' => 'c'));
      // This third one is a custom value from contrib/patches/center_blocks_position_patch and the
      // flex page course format. Hopefully this new value is an adequate alternative.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            poltawski Dan Poltawski
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10