From 567b5022f26f862c93a391746d40cb7937f743e7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 29 Sep 2021 10:43:52 -0700 Subject: [PATCH] Fix for customfields Youtube video preview not displaying after selection. --- e107_admin/image.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index cb9e9b907..fcfa01c42 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -2386,14 +2386,20 @@ class media_admin_ui extends e_admin_ui if(!empty($data)) { $tp = e107::getParser(); + + foreach($data['items'] as $value) { $id = $value['id']['videoId']; $thumbnail = $value['snippet']['thumbnails']['medium']['url']; + + $items[] = array( - 'previewHtml' => $bbcode ? null : $tp->toVideo($id. '.' .$extension, array('w' =>210, 'h' =>140)), + // 'previewHtml' => $bbcode !== 'video' ? null : $tp->toVideo($id. '.' .$extension, array('w' =>210, 'h' =>140)), + 'previewHtml' => $tp->toVideo($id. '.' .$extension, array('w' =>210, 'h' =>140)), + 'previewUrl' => $thumbnail, 'saveValue' => $id. '.' .$extension, // youtube", 'thumbUrl' => $thumbnail,