MDL-59562 core: changed branch behaviour during initial install.
authorPeter Burnett <peterburnett@catalyst-au.net>
Wed, 15 Jan 2020 05:46:46 +0000 (15:46 +1000)
committerPeter Burnett <peterburnett@catalyst-au.net>
Wed, 15 Jan 2020 05:46:46 +0000 (15:46 +1000)
lib/classes/plugin_manager.php

index c666c38..55fcf18 100644 (file)
@@ -753,6 +753,13 @@ class core_plugin_manager {
         global $CFG;
         if (empty($branch)) {
             $branch = $CFG->branch;
+            if (empty($branch)) {
+                // During initial install there is no branch set.
+                require($CFG->dirroot . '/version.php');
+                $branch = (int)$branch;
+                // Force CFG->branch to int value during install.
+                $CFG->branch = $branch;
+            }
         }
         $return = true;
         foreach ($this->get_plugins() as $type => $plugins) {