From 3375ef6fea990d171075b54d65cbc9cddedd5ee0 Mon Sep 17 00:00:00 2001 From: katcher Date: Wed, 18 Mar 2020 09:17:19 -0400 Subject: [PATCH 1/5] Issue 189 Unable to find Class 'core\ip_utils' Following upgrade of moodle to 3.5.11, error above prevented moodle from displaying on the web. The class ip_utils was for somereason not loaded and through an error preventing the site from displaying when in maintenance mod. Adding the require class appears to have fixed the issue. --- classes/local/outagelib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index 43edb6f..287d94c 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -253,6 +253,7 @@ class outagelib { if ((time() >= {{STARTTIME}}) && (time() < {{STOPTIME}})) { define('MOODLE_INTERNAL', true); require_once($CFG->dirroot.'/lib/moodlelib.php'); + require_once($CFG->dirroot.'/lib/classes/ip_utils.php'); if (!remoteip_in_list('{{ALLOWEDIPS}}')) { header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance'); header('Status: 503 Moodle under maintenance'); From c56025bcdd676249d4a306ea849a6e2e9256e14c Mon Sep 17 00:00:00 2001 From: Heena Agheda Date: Thu, 2 Jul 2020 14:38:13 +1000 Subject: [PATCH 2/5] Upgrade postgresql version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96d4f54..da48dfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: - $HOME/.composer/cache addons: - postgresql: "9.3" + postgresql: "9.5" php: - 7.0 From 186c75b00b281af962a4379fc370e024e80e91bb Mon Sep 17 00:00:00 2001 From: Heena Agheda Date: Fri, 3 Jul 2020 09:47:21 +1000 Subject: [PATCH 3/5] Fix failing tests --- tests/phpunit/local/outagelib_test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/local/outagelib_test.php b/tests/phpunit/local/outagelib_test.php index 69b470f..c6b5ae0 100644 --- a/tests/phpunit/local/outagelib_test.php +++ b/tests/phpunit/local/outagelib_test.php @@ -31,7 +31,7 @@ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir.'/adminlib.php'); - +require_once(__DIR__.'/../base_testcase.php'); /** * outagelib_test test class. * @@ -293,6 +293,7 @@ class outagelib_test extends auth_outage_base_testcase { if ((time() >= 123) && (time() < 456)) { define('MOODLE_INTERNAL', true); require_once($CFG->dirroot.'/lib/moodlelib.php'); + require_once($CFG->dirroot.'/lib/classes/ip_utils.php'); if (!remoteip_in_list('heyyou a.b.c.d e.e.e.e/20')) { @@ -333,6 +334,7 @@ EOT; if ((time() >= 123) && (time() < 456)) { define('MOODLE_INTERNAL', true); require_once($CFG->dirroot.'/lib/moodlelib.php'); + require_once($CFG->dirroot.'/lib/classes/ip_utils.php'); if (!remoteip_in_list('127.0.0.1')) { header($_SERVER['SERVER_PROTOCOL'] . ' 503 Moodle under maintenance'); header('Status: 503 Moodle under maintenance'); From be259f6ee529240531715d8fd8ab44da85875162 Mon Sep 17 00:00:00 2001 From: Heena Agheda Date: Fri, 3 Jul 2020 10:19:10 +1000 Subject: [PATCH 4/5] Upgrade PHP version --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index da48dfc..a6d1e73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,9 @@ env: matrix: include: - - php: 5.5 + - php: 5.6 env: DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE - - php: 5.5 + - php: 5.6 env: DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE before_install: From ab26bae579da2155b5fa4aa1eb38c8f506a28fba Mon Sep 17 00:00:00 2001 From: Heena Agheda Date: Fri, 3 Jul 2020 10:41:01 +1000 Subject: [PATCH 5/5] Add services: mysql --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index a6d1e73..14fbb3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ addons: php: - 7.0 +services: + - mysql + env: - DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE - DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE