Skip to content

Commit 52793b0

Browse files
committed
various fixes
1 parent 78bbf79 commit 52793b0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/Models/Helpers.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,17 +443,18 @@ public static function isWorldReadable($oc_acls)
443443
*/
444444
public static function getAllRecordedSeriesIds(bool $force = false)
445445
{
446-
$cache = StudipCacheFactory::getCache();
446+
$cache = \StudipCacheFactory::getCache();
447447
$all_known_seriesids = $cache->read(self::RECORDED_SERIES_ID_CACHE_ID);
448-
if ($force || empty($cache_data)) {
449-
$all_known_seriesids = [];
448+
if ($force || empty($all_known_seriesids)) {
449+
$combined_records = [];
450450
$user_series_ids =\SimpleCollection::createFromArray(
451451
UserSeries::findBySql('1')
452-
)->toArray()->pluck('series_id');
452+
)->toArray();
453453
$seminar_series_ids =\SimpleCollection::createFromArray(
454454
SeminarSeries::findBySql('1')
455-
)->toArray()->pluck('series_id');
456-
$all_known_seriesids = array_merge($user_series_ids, $seminar_series_ids);
455+
)->toArray();
456+
$combined_records = array_merge($user_series_ids, $seminar_series_ids);
457+
$all_known_seriesids = array_column($combined_records, 'series_id');
457458
$all_known_seriesids = array_unique($all_known_seriesids);
458459
$cache->write(self::RECORDED_SERIES_ID_CACHE_ID, $all_known_seriesids);
459460
}
@@ -479,7 +480,8 @@ public static function isEventInThisStudip($oc_event)
479480
}
480481

481482
$all_known_seriesids = self::getAllRecordedSeriesIds();
482-
if (in_array($event->is_part_of, $all_known_seriesids)) {
483+
484+
if (in_array($oc_event->is_part_of, $all_known_seriesids)) {
483485
return true;
484486
}
485487

@@ -497,7 +499,7 @@ public static function isEventInThisStudip($oc_event)
497499
*/
498500
public static function invalidateRecordedSeriesIdsCache()
499501
{
500-
$cache = StudipCacheFactory::getCache();
502+
$cache = \StudipCacheFactory::getCache();
501503
$cache->expire(self::RECORDED_SERIES_ID_CACHE_ID);
502504
}
503505
}

0 commit comments

Comments
 (0)