Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/202064
Change subject: Rename 'source' property to 'original' ...................................................................... Rename 'source' property to 'original' There's already a 'source' that points to the thumbnail URL source and thus two 'sources' are confusing. Call it 'original' intead, and move it to inside the 'thumbnail' dict so it is clear what it is an original of Bug: T94928 Change-Id: I3298e9ab511226c17010dc018f6e7d5f0a0babe5 (cherry picked from commit e1786ece26e39a0e52de91ea8ef854254e5a99dc) --- M ApiQueryPageImages.php 1 file changed, 12 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageImages refs/changes/64/202064/1 diff --git a/ApiQueryPageImages.php b/ApiQueryPageImages.php index e451346..a629f6e 100644 --- a/ApiQueryPageImages.php +++ b/ApiQueryPageImages.php @@ -89,7 +89,7 @@ */ protected function setResultValues( $prop, $pageId, $fileName, $size ) { $vals = array(); - if ( isset( $prop['thumbnail'] ) || isset( $prop['source'] ) ) { + if ( isset( $prop['thumbnail'] ) || isset( $prop['original'] ) ) { $file = wfFindFile( $fileName ); if ( isset( $prop['thumbnail'] ) ) { @@ -108,8 +108,15 @@ } } - if ( isset( $prop['source'] ) ) { - $vals['source'] = wfExpandUrl( $file->getUrl(), PROTO_CURRENT ); + if ( isset( $prop['original'] ) ) { + $original_url = wfExpandUrl( $file->getUrl(), PROTO_CURRENT ); + if ( isset( $vals['thumbnail'] ) ) { + $vals['thumbnail']['original'] = $original_url; + } else { + $vals['thumbnail'] = array( + 'original' => $original_url, + ); + } } } @@ -130,7 +137,7 @@ public function getAllowedParams() { return array( 'prop' => array( - ApiBase::PARAM_TYPE => array( 'thumbnail', 'name', 'source' ), + ApiBase::PARAM_TYPE => array( 'thumbnail', 'name', 'original' ), ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_DFLT => 'thumbnail|name', ), @@ -161,7 +168,7 @@ 'prop' => array( 'What information to return', ' thumbnail - URL and dimensions of image associated with page, if any', ' name - image title', - ' source - URL to the image original', + ' original - URL to the image original', ), 'thumbsize' => 'Maximum thumbnail dimension', 'limit' => 'Properties of how many pages to return', -- To view, visit https://gerrit.wikimedia.org/r/202064 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3298e9ab511226c17010dc018f6e7d5f0a0babe5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageImages Gerrit-Branch: wmf/1.25wmf23 Gerrit-Owner: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits