Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect info in change course playlist dialog #1048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/Models/PlaylistSeminars.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected static function configure($config = [])
public function toSanitizedArray()
{
$playlist_data = $this->playlist->toSanitizedArray();
$playlist_data['videos_count'] = count($this->seminar_videos);
$playlist_data['visibility'] = $this->visibility;

// Always prioritise allow download property of seminar playlist
Expand Down
4 changes: 4 additions & 0 deletions lib/Models/Playlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ public function toSanitizedArray()
{
$data = $this->toArray();
unset($data['id']);

$data['mkdate'] = ($this->mkdate == '0000-00-00 00:00:00')
? 0 : \strtotime($this->mkdate);

$data['videos_count'] = count($this->videos);

$data['tags'] = $this->tags->toArray();
Expand Down
2 changes: 0 additions & 2 deletions lib/Routes/Playlist/PlaylistList.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public function __invoke(Request $request, Response $response, $args)

$playlist_list = [];
foreach ($playlists['playlists'] as $playlist) {
$playlist['mkdate'] = ($playlist['mkdate'] == '0000-00-00 00:00:00')
? 0 : \strtotime($playlist['mkdate']);
$playlist_list[$playlist->id] = $playlist->toSanitizedArray();

// Adding the tooltip text for the playlist that is default in a course.
Expand Down
Loading