MDL-62270 Privacy: Cron task fails when admin directory renamed
authoradamtppaw <adam.pawelczak@neokrates.pl>
Sun, 3 Jun 2018 20:12:43 +0000 (22:12 +0200)
committeradamtppaw <adam.pawelczak@neokrates.pl>
Sun, 3 Jun 2018 20:12:43 +0000 (22:12 +0200)
admin/tool/dataprivacy/classes/task/initiate_data_request_task.php
admin/tool/dataprivacy/classes/task/process_data_request_task.php

index 2ee4a0a..70402f4 100644 (file)
@@ -54,7 +54,7 @@ class initiate_data_request_task extends adhoc_task {
     public function execute() {
         global $CFG;
 
-        require_once($CFG->dirroot . '/admin/tool/dataprivacy/lib.php');
+        require_once($CFG->dirroot . "/{$CFG->admin}/tool/dataprivacy/lib.php");
 
         if (!isset($this->get_custom_data()->requestid)) {
             throw new coding_exception('The custom data \'requestid\' is required.');
index 6a93217..c58f574 100644 (file)
@@ -57,7 +57,7 @@ class process_data_request_task extends adhoc_task {
     public function execute() {
         global $CFG, $PAGE, $SITE;
 
-        require_once($CFG->dirroot . '/admin/tool/dataprivacy/lib.php');
+        require_once($CFG->dirroot . "/{$CFG->admin}/tool/dataprivacy/lib.php");
 
         if (!isset($this->get_custom_data()->requestid)) {
             throw new coding_exception('The custom data \'requestid\' is required.');