Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/199628

Change subject: Avoid fatal error when a collection has an image associated 
with it
......................................................................

Avoid fatal error when a collection has an image associated with it

Visiting
http://localhost:8888/w/index.php/Special:Gather/Jdlrobson/4 where
collection 4 has an image throws a fatal.

Change-Id: Ie33247644ee21e42658e4a4983f6dadeae423fbf
---
M includes/models/Collection.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/28/199628/1

diff --git a/includes/models/Collection.php b/includes/models/Collection.php
index 6e62858..942d326 100644
--- a/includes/models/Collection.php
+++ b/includes/models/Collection.php
@@ -131,8 +131,9 @@
                                $lists = $data['query']['lists'];
                                if ( count( $lists ) === 1 ) {
                                        $list = $lists[0];
+                                       $image = $list['image'] ? wfFindFile( 
$list['image'] ) : null;
                                        $collection = new Collection( $id, 
$user, $list['label'], $list['description'],
-                                               $list['public'], $list['image'] 
);
+                                               $list['public'], $image );
                                }
                        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie33247644ee21e42658e4a4983f6dadeae423fbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

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

Reply via email to