mirror of
https://github.com/nextcloud/integration_moodle.git
synced 2025-12-17 21:02:05 +01:00
refs #13 don't ignore recent items with missing timeaccess
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
parent
eddf1fb5da
commit
a8ff3aa2ae
1 changed files with 1 additions and 4 deletions
|
|
@ -67,14 +67,11 @@ class MoodleAPIService {
|
|||
$courseIds = [];
|
||||
$recents = [];
|
||||
foreach ($recentItems as $k => $recentItem) {
|
||||
if (!is_array($recentItem) || !isset($recentItem['timeaccess'])) {
|
||||
continue;
|
||||
}
|
||||
if (isset($recentItem['courseid']) && !in_array($recentItem['courseid'], $courseIds)) {
|
||||
$courseIds[] = $recentItem['courseid'];
|
||||
}
|
||||
$recent = $recentItem;
|
||||
$recent['time'] = $recentItem['timeaccess'];
|
||||
$recent['time'] = $recentItem['timeaccess'] ?? 0;
|
||||
$recent['type'] = 'recent';
|
||||
$recents[] = $recent;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue