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

Upgrade fails when adding fields to tag_instance table.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.0.2
    • 2.0, 2.0.1
    • Installation, Tags
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

      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.

            dongsheng Dongsheng Cai
            markn Mark Nelson
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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