Skip to content

Commit a8a04cf

Browse files
committed
better conditions for video block migration
1 parent 86fad0b commit a8a04cf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

command/MigrateCoursewareCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ private function createBlock($block, $container)
894894
$file_id = $webvideo->file_id;
895895
$web_url = '';
896896
}
897-
if ($webvideo->src) {
897+
if ((!$webvideo->source || typeof $webvideo->source === "undefined") && $webvideo->src) {
898898
$url = $webvideo->src;
899899
if (strpos($url, 'youtube.com') || strpos($url, 'youtu.be')) {
900900
// convert this to a EmbedBlock
@@ -907,7 +907,7 @@ private function createBlock($block, $container)
907907
$addBlock = true;
908908
break;
909909
} else {
910-
parse_str(parse_url($webvideo->src)['query'], $src_params);
910+
parse_str(parse_url($url)['query'], $src_params);
911911
$file_id = $src_params['file_id'];
912912
$file = \FileRef::find($file_id);
913913
if ($file) {
@@ -917,7 +917,7 @@ private function createBlock($block, $container)
917917
} else {
918918
$source = 'web';
919919
$file_id = '';
920-
$web_url = $webvideo->src;
920+
$web_url = $url;
921921
}
922922
}
923923
}

0 commit comments

Comments
 (0)