jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/336569 )

Change subject: Do not generate responsive images for iconThumb
......................................................................


Do not generate responsive images for iconThumb

Should fix the notice "Undefined index: width" which is presumably due
to Linker::processResponsiveImages() being called when
makeTransformOptions() fails to fetch the handler and so returns an
empty array.

Bug: T138987
Change-Id: Ib661c0a562c5ae68d5591df362558956e982b6a1
---
M includes/ApiParsoidBatch.php
1 file changed, 9 insertions(+), 6 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ApiParsoidBatch.php b/includes/ApiParsoidBatch.php
index 5f38ecd..7fb456f 100644
--- a/includes/ApiParsoidBatch.php
+++ b/includes/ApiParsoidBatch.php
@@ -287,12 +287,15 @@
                        if ( $mto->isError() ) {
                                $result['thumberror'] = $mto->toText();
                        } else {
-                               // Do srcset scaling
-                               Linker::processResponsiveImages( $file, $mto, 
$txopts );
-                               if ( count( $mto->responsiveUrls ) ) {
-                                       $result['responsiveUrls'] = array();
-                                       foreach ( $mto->responsiveUrls as 
$density => $url ) {
-                                               
$result['responsiveUrls'][$density] = wfExpandUrl( $url, PROTO_CURRENT );
+                               if ( $txopts ) {
+                                       // Do srcset scaling
+                                       Linker::processResponsiveImages( $file, 
$mto, $txopts );
+                                       if ( count( $mto->responsiveUrls ) ) {
+                                               $result['responsiveUrls'] = 
array();
+                                               foreach ( $mto->responsiveUrls 
as $density => $url ) {
+                                                       
$result['responsiveUrls'][$density] = wfExpandUrl(
+                                                               $url, 
PROTO_CURRENT );
+                                               }
                                        }
                                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/336569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib661c0a562c5ae68d5591df362558956e982b6a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParsoidBatchAPI
Gerrit-Branch: master
Gerrit-Owner: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to