Skip to content

Commit

Permalink
Fix Musora API ContentController array offset on value of type null (#34
Browse files Browse the repository at this point in the history
)
  • Loading branch information
roxanariza authored May 24, 2024
1 parent 32e06ce commit c7b15d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Controllers/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ public function getContentOptimised($contentId, Request $request, $playlistItemI
}

$content = $this->contentService->getById($contentId);

if(($content['type'] == 'pack-bundle' || $content['type'] == 'pack') && (user()?->isEnrolledIntoCohort(\Arr::pluck($content['permissions'], 'permission_id')))){
ContentRepository::$pullFutureContent = true;
}
if (!$content) {
$userId = user()?->id;
Log::warning("No content with id $contentId exists. (userId:$userId)");
Expand All @@ -254,6 +250,11 @@ public function getContentOptimised($contentId, Request $request, $playlistItemI
);
}

//Display all cohort lessons(including lessons that haven't been released) on the apps too
if(($content['type'] == 'pack-bundle' || $content['type'] == 'pack') && (user()?->isEnrolledIntoCohort(\Arr::pluck($content['permissions'], 'permission_id')))){
ContentRepository::$pullFutureContent = true;
}

$decoratorsEnabled = Decorator::$typeDecoratorsEnabled;
Decorator::$typeDecoratorsEnabled = false;

Expand Down

0 comments on commit c7b15d3

Please sign in to comment.