Merge branch 'MDL-57412-master' of https://github.com/xow/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Wed, 23 Aug 2017 08:56:41 +0000 (16:56 +0800)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 23 Aug 2017 09:15:34 +0000 (11:15 +0200)
1  2 
lib/db/upgrade.php
version.php

@@@ -2308,50 -2308,21 +2308,66 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2017080700.01);
      }
  
 -    if ($oldversion < 2017081700.01) {
 +    if ($oldversion < 2017082200.00) {
 +        $plugins = ['radius', 'fc', 'nntp', 'pam', 'pop3', 'imap'];
 +
 +        foreach ($plugins as $plugin) {
 +            // Check to see if the plugin exists on disk.
 +            // If it does not, remove the config for it.
 +            if (!file_exists($CFG->dirroot . "/auth/{$plugin}/auth.php")) {
 +                // Clean config.
 +                unset_all_config_for_plugin("auth_{$plugin}");
 +            }
 +        }
 +        upgrade_main_savepoint(true, 2017082200.00);
 +    }
 +
 +    if ($oldversion < 2017082200.01) {
 +
 +        // Define table analytics_indicator_calc to be created.
 +        $table = new xmldb_table('analytics_indicator_calc');
 +
 +        // Adding fields to table analytics_indicator_calc.
 +        $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
 +        $table->add_field('starttime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('endtime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('sampleorigin', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('sampleid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('indicator', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('value', XMLDB_TYPE_NUMBER, '10, 2', null, null, null, null);
 +        $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +
 +        // Adding keys to table analytics_indicator_calc.
 +        $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
 +
 +        // Adding indexes to table analytics_indicator_calc.
 +        $table->add_index('starttime-endtime-contextid', XMLDB_INDEX_NOTUNIQUE, array('starttime', 'endtime', 'contextid'));
 +
 +        // Conditionally launch create table for analytics_indicator_calc.
 +        if (!$dbman->table_exists($table)) {
 +            $dbman->create_table($table);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2017082200.01);
 +    }
 +
++    if ($oldversion < 2017082300.01) {
+         // This script in included in each major version upgrade process so make sure we don't run it twice.
+         if (empty($CFG->linkcoursesectionsupgradescriptwasrun)) {
+             // Check if the site is using a boost-based theme.
+             // If value of 'linkcoursesections' is set to the old default value, change it to the new default.
+             if (upgrade_theme_is_from_family('boost', $CFG->theme)) {
+                 set_config('linkcoursesections', 1);
+             }
+             set_config('linkcoursesectionsupgradescriptwasrun', 1);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2017081700.01);
++        upgrade_main_savepoint(true, 2017082300.01);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2017082300.00;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2017081700.01;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2017082300.01;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.