-
Bug
-
Resolution: Fixed
-
Critical
-
3.6
-
MOODLE_36_STABLE
-
MOODLE_36_STABLE
-
MDL-63086-master -
This is a regression of MDL-61960, that was integrated only for 3.6. Carrying information from there:
Note that a regression with this patch has been detected. To reproduce:
- Have a non-working rss feed in your site (you can edit one of the current ones to make it fail).
- Run:
php admin/tool/task/cli/schedule_task.php --execute=\\block_rss_client\\task\\refreshfeeds
- You get:
http://xxx.xxx.xxx.xxx/rss.xml PHP Notice: A feed could not be found at `http://xxx.xxx.xxx.xxx/rss.xml`; the status code is `503` and content-type is `text/html; charset=utf-8` in /lib/simplepie/library/SimplePie.php on line 1702
Default exception handler: Exception - Class 'block_rss_client' not found Debug:
Error code: generalexceptionmessage
* line 101 of /blocks/rss_client/classes/task/refreshfeeds.php: Error thrown
* line 156 of /admin/tool/task/cli/schedule_task.php: call to block_rss_client\task\refreshfeeds->execute()
!!! Exception - Class 'block_rss_client' not found !!!
- Proposed solution 1, tested locally, just add the missing classes needed when a rss fails:
diff --git a/blocks/rss_client/classes/task/refreshfeeds.php b/blocks/rss_client/classes/task/refreshfeeds.php
index 3e34e1b183..0feb681bd3 100644
--- a/blocks/rss_client/classes/task/refreshfeeds.php
+++ b/blocks/rss_client/classes/task/refreshfeeds.php
@@ -66,6 +66,8 @@ class refreshfeeds extends \core\task\scheduled_task {
public function execute() {
global $CFG, $DB;
require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
+ require_once($CFG->dirroot . '/blocks/moodleblock.class.php');
+ require_once($CFG->dirroot . '/blocks/rss_client/block_rss_client.php');
// We are going to measure execution times.
$starttime = microtime();
- Proposed solution 2, move the calculate_skiptime() method to the task, so no instantiation of the block is needed. It seems it's not used elsewhere.
Ciao