Catrope has uploaded a new change for review.

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

Change subject: Return any image, not just the non-free image
......................................................................

Return any image, not just the non-free image

The mobileview API directly accesses the page image,
bypassing the PageImages API.

I1d35e965dc37c8c4ecdcc43313b3198e951e1978 fixes the issue for
the PageImages API.

This patch fixes the issue for the mobileview API.

Change-Id: If6cbb82f01fa298945c615a2f25e972a9d767d58
(cherry picked from commit 250103022d85b5914e626e498e00b759634d9105)
---
M includes/PageImages.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageImages 
refs/changes/76/325076/1

diff --git a/includes/PageImages.php b/includes/PageImages.php
index 96b7a9f..be36510 100644
--- a/includes/PageImages.php
+++ b/includes/PageImages.php
@@ -39,16 +39,16 @@
         */
        public static function getPageImage( Title $title ) {
                $dbr = wfGetDB( DB_SLAVE );
-               $name = $dbr->selectField( 'page_props',
+               $name = $dbr->selectFieldValues( 'page_props',
                        'pp_value',
-                       [ 'pp_page' => $title->getArticleID(), 'pp_propname' => 
self::PROP_NAME ],
+                       [ 'pp_page' => $title->getArticleID(), 'pp_propname' => 
[ self::PROP_NAME, self::PROP_NAME_FREE ] ],
                        __METHOD__
                );
 
                $file = false;
 
                if ( $name ) {
-                       $file = wfFindFile( $name );
+                       $file = wfFindFile( $name[0] );
                }
 
                return $file;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6cbb82f01fa298945c615a2f25e972a9d767d58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageImages
Gerrit-Branch: wmf/1.29.0-wmf.4
Gerrit-Owner: Catrope <r...@wikimedia.org>
Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org>

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

Reply via email to