diff --git a/classes/cachemanager.php b/classes/cachemanager.php index a2e8d80..78fe7a7 100644 --- a/classes/cachemanager.php +++ b/classes/cachemanager.php @@ -79,6 +79,9 @@ public static function build_backlink_cache(int $courseid = 0) { $coursepageurl = course_get_format($module->course)->get_view_url($module->sectionnum); $coursepageurl->set_anchor('module-' . $module->id); foreach ($placestore->places as $place) { + if (!isset($place->linkedActivity)) { + continue; + } $url = !empty($module->showdescription) ? $coursepageurl->out() : new \moodle_url('/mod/learningmap/view.php', ['id' => $module->id]); diff --git a/classes/task/fill_backlink_cache.php b/classes/task/fill_backlink_cache.php index a5e05cf..3274bbb 100644 --- a/classes/task/fill_backlink_cache.php +++ b/classes/task/fill_backlink_cache.php @@ -49,7 +49,7 @@ public function execute() { $fillstate = $cache->get('fillstate'); // If the cache is filled within the last 24 hours, do nothing. - if (!empty($fillstate) && $fillstate < time() - 60 * 60 * 24) { + if (!empty($fillstate) && $fillstate > time() - 60 * 60 * 24) { mtrace('Backlink cache is already filled within the last 24 hours. Exiting.'); return; }