jenkins-bot has submitted this change and it was merged. Change subject: Fix fatal for TimedMediaHandler previews without files. ......................................................................
Fix fatal for TimedMediaHandler previews without files. The TimedMediaHandler extension is used to create playback thumbnails for ogg files rendered by the Score extension. In this case, the TimedMediaHandler has no file connected to it, so code inside the thumbnail renderer and any code called from that renderer, should not depend on the presence of a source file. Follow-up to: I4227b88 Bug: T135491 Change-Id: I62b02a73679b82b0feae92fa244b57e782c51385 --- M TimedMediaTransformOutput.php 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Brion VIBBER: Looks good to me, approved jenkins-bot: Verified diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php index 927dcb2..31008e4 100644 --- a/TimedMediaTransformOutput.php +++ b/TimedMediaTransformOutput.php @@ -286,7 +286,11 @@ /** * Call mediaWiki xml helper class to build media tag output from - * supplied arrays + * supplied arrays. + * + * This function is also called by the Score extension, in which case + * there is no connection to a file object. + * * @param $sizeOverride array * @param $autoPlay boolean sets the autoplay attribute * @return string @@ -327,7 +331,7 @@ } } } - $mediaTracks = $this->getTextHandler()->getTracks(); + $mediaTracks = $this->file ? $this->getTextHandler()->getTracks() : null; foreach ( $mediaTracks as &$track ) { foreach ( $track as $attr => $val ) { if ( $attr === 'title' || $attr === 'provider' ) { -- To view, visit https://gerrit.wikimedia.org/r/289197 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62b02a73679b82b0feae92fa244b57e782c51385 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ <hartman.w...@gmail.com> Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org> Gerrit-Reviewer: TheDJ <hartman.w...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits