Moodle
  1. Moodle
  2. MDL-38450

Warnings on upgrade from 2.2.7 to 2.2.8

    Details

    • Testing Instructions:
      1. Install a moodle 2.2.7 site (older than 2a9af190)
      2. Upgrade it to MOODLE_22_STABLE integration branch
      3. No warnings/errors should occur during the upgrade
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
      git@github.com:totara/moodle.git
    • Rank:
      48405

      Description

      *Steps to reproduce*

      1. Install a fresh Moodle 2.2.7 site
      2. Replace the code with the 2.2.8 code
      3. Visit the notification page to trigger the upgrade

      What should happen

      Upgrade should complete without errors

      What happens

      The following errors are displayed during upgrade:

      mod_label
      
      XMLDB has detected one CHAR NOT NULL column (name) with '' (empty string) as DEFAULT value. This type of columns must have one meaningful DEFAULT declared or none (NULL). XMLDB have fixed it automatically changing it to none (NULL). The process will continue ok and proper defaults will be created accordingly with each DB requirements. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 208 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 94 of /mod/label/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_label_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      XMLDB has detected one TEXT/BINARY column (intro) with some DEFAULT defined. This type of columns cannot have any default value. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 214 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 95 of /mod/label/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_label_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      Success
      mod_survey
      
      XMLDB has detected one TEXT/BINARY column (intro) with some DEFAULT defined. This type of columns cannot have any default value. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 214 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 71 of /mod/survey/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_survey_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      XMLDB has detected one CHAR NOT NULL column (questions) with '' (empty string) as DEFAULT value. This type of columns must have one meaningful DEFAULT declared or none (NULL). XMLDB have fixed it automatically changing it to none (NULL). The process will continue ok and proper defaults will be created accordingly with each DB requirements. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 208 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 72 of /mod/survey/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_survey_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      XMLDB has detected one TEXT/BINARY column (answer1) with some DEFAULT defined. This type of columns cannot have any default value. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 214 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 74 of /mod/survey/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_survey_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      XMLDB has detected one TEXT/BINARY column (answer2) with some DEFAULT defined. This type of columns cannot have any default value. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 214 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 75 of /mod/survey/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_survey_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      XMLDB has detected one CHAR NOT NULL column (intro) with '' (empty string) as DEFAULT value. This type of columns must have one meaningful DEFAULT declared or none (NULL). XMLDB have fixed it automatically changing it to none (NULL). The process will continue ok and proper defaults will be created accordingly with each DB requirements. Please fix it in source (XML and/or upgrade script) to avoid this message to be displayed.
      line 2000 of /lib/datalib.php: call to debugging()
      line 426 of /lib/xmldb/xmldb_object.php: call to xmldb_debug()
      line 208 of /lib/xmldb/xmldb_field.php: call to xmldb_object->debug()
      line 104 of /lib/xmldb/xmldb_field.php: call to xmldb_field->setDefault()
      line 62 of /lib/xmldb/xmldb_field.php: call to xmldb_field->set_attributes()
      line 76 of /mod/survey/db/upgrade.php: call to xmldb_field->__construct()
      line 540 of /lib/upgradelib.php: call to xmldb_survey_upgrade()
      line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      line 269 of /admin/index.php: call to upgrade_noncore()
      Success
      

        Issue Links

          Activity

          Hide
          Simon Coggins added a comment -

          The problem is that some fields are defined with a default of '' which is no longer allowed. Changing the default to null fixes the issue.

          Show
          Simon Coggins added a comment - The problem is that some fields are defined with a default of '' which is no longer allowed. Changing the default to null fixes the issue.
          Hide
          Mark Nelson added a comment -

          Hi Simon, thanks for providing a patch for this issue. It looks great to me. Submitting to integration.

          Show
          Mark Nelson added a comment - Hi Simon, thanks for providing a patch for this issue. It looks great to me. Submitting to integration.
          Hide
          Mark Nelson added a comment -

          Hi Simon, quick question. I am just wondering why this error was not present when MDL-38003 was tested? Was there something introduced recently that performs this check?

          Show
          Mark Nelson added a comment - Hi Simon, quick question. I am just wondering why this error was not present when MDL-38003 was tested? Was there something introduced recently that performs this check?
          Hide
          Simon Coggins added a comment -

          It's a good question, I tried upgrading from a commit just before the MDL-38003 patch (2a9af190) to one just after (87fe3c03) and I got the same errors. Maybe it was tested with debugging off?

          Show
          Simon Coggins added a comment - It's a good question, I tried upgrading from a commit just before the MDL-38003 patch (2a9af190) to one just after (87fe3c03) and I got the same errors. Maybe it was tested with debugging off?
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Damyon Wiese added a comment -

          Thanks Simon,

          This change looks safe as this is the default that the xmldb would have applied anyway - I tested this patch before/after and verified that it made the warnings on upgrade go away (yay!).

          Integrated to 22 only.

          Show
          Damyon Wiese added a comment - Thanks Simon, This change looks safe as this is the default that the xmldb would have applied anyway - I tested this patch before/after and verified that it made the warnings on upgrade go away (yay!). Integrated to 22 only.
          Hide
          David Monllaó added a comment -

          It passes, upgrade through web UI finished as expected

          Show
          David Monllaó added a comment - It passes, upgrade through web UI finished as expected
          Hide
          Damyon Wiese added a comment -

          This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

          Thanks for your contributions!

          Show
          Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: