jenkins-bot has submitted this change and it was merged.
Change subject: Fix warnings on Special:TimedMediaHandler (undefined variable
line 164)
......................................................................
Fix warnings on Special:TimedMediaHandler (undefined variable line 164)
You can get variable undefined warnings if you don't have a lot of
succesful transcodes registered.
Change-Id: I9cb68053cc5a02741789002da8be8e49e184921c
---
M SpecialTimedMediaHandler.php
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php
index b59680a..8403dd9 100644
--- a/SpecialTimedMediaHandler.php
+++ b/SpecialTimedMediaHandler.php
@@ -135,6 +135,11 @@
$stats[ 'transcodes' ] = array( 'total' => 0 );
foreach ( $this->transcodeStates as $state => $condition ) {
$stats[ $state ] = array( 'total' => 0 );
+ foreach( $wgEnabledTranscodeSet as $type ) {
+ // Important to pre-initialize, as can give
+ // warnings if you don't have a lot of things
in transcode table.
+ $stats[ $state ][ $type ] = 0;
+ }
}
foreach ( $this->transcodeStates as $state => $condition ) {
$cond = array( 'transcode_key' =>
$wgEnabledTranscodeSet );
@@ -157,7 +162,6 @@
__METHOD__,
array( 'GROUP BY' => 'transcode_key' )
);
-
foreach( $res as $row ) {
$key = $row->transcode_key;
$stats[ 'transcodes' ][ $key ] = $row->count;
--
To view, visit https://gerrit.wikimedia.org/r/68806
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9cb68053cc5a02741789002da8be8e49e184921c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits