When attempting to preview the static page from a planned outage, the following PHP exception is raised:
PHP message: Default exception handler: Exception: Class 'curl' not found
Debug:
Error code: generalexceptionmessage
* line 62 of /auth/outage/classes/local/outagelib.php: Error thrown
* line 68 of /auth/outage/classes/local/controllers/maintenance_static_page_io.php: call to auth_outage\\local\\outagelib::fetch_page()
* line 64 of /auth/outage/classes/local/controllers/maintenance_static_page.php: call to auth_outage\\local\\controllers\\maintenance_static_page_io::file_get_data()
* line 38 of /auth/outage/preview.php: call to auth_outage\\local\\controllers\\maintenance_static_page::create_from_outage()
This appears to fix the problem:
diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php
index e17dce1..baa7a08 100644
--- a/classes/local/outagelib.php
+++ b/classes/local/outagelib.php
@@ -59,6 +59,8 @@ class outagelib {
private static $injectcalled = false;
public static function fetch_page($file) {
+ global $CFG;
+ require_once($CFG->libdir . '/filelib.php');
$curl = new curl();
$contents = $curl->get($file);
$info = $curl->get_info();
When attempting to preview the static page from a planned outage, the following PHP exception is raised:
This appears to fix the problem:
Moodle 3.9.4, PHP 7.3.27