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

Upgrade fails when adding fields to tag_instance table.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Installation, Tags
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Here is the stack track, it explains the issue.

      Debug info: Field tag_instance->tiuserid cannot be added. Not null fields added to non empty tables require default value. Create skipped
      Stack trace:

      • line 579 of /lib/ddl/database_manager.php: ddl_exception thrown
      • line 243 of /lib/db/upgrade.php: call to database_manager->add_field()
      • line 1309 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      • line 252 of /admin/index.php: call to upgrade_core()

      Looking at line 242 in /lib/db/upgrade.php contains the following line: $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, 'itemid');

      Changing this to: $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'itemid'); fixes the issue. It is also possible to set the other field to XMLDB_NULL instead.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dongsheng Dongsheng Cai
              Reporter:
              markn Mark Nelson
              Tester:
              David Mudrák (@mudrd8mz)
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                21/Feb/11