Commit graph

23 commits

Author SHA1 Message Date
jenkins-bot 2d8fe5b5f7 Merge "Add example to ApiQueryPageImages via getExamplesMessages" 2015-10-09 13:47:52 +00:00
S Page cc9d7b143f Add example to ApiQueryPageImages via getExamplesMessages
Bug: T89035
Change-Id: Ia3410a35d7bfb1c234f2356b272c56a94cb11efb
2015-10-08 18:01:21 -07:00
Sam Smith 56243a6c65 Include foreign files in ApiQueryPageImages
Titles that correspond to foreign files aren't included in the set of
titles returned by ApiPageSet#getGoodTitles. However, since
ApiQueryPageImages#execute finds files with wfFindFile, these "missing"
titles can be included.

Add the ApiQueryPageImages#getTitles helper function, which returns the
set of "good" titles union the set of missing titles in the File
namespace.

Also, register the PHPUnit tests directory in the UnitTestsList hook
handler.

The original version of this patch was reverted due to a (stupid) bug
wherein a fatal error was triggered because there was no check for there
being no missing titles in the File namespace [0] and, consequently, an
invalid operand was being passed to the array union operator. This bug
is fixed as well as proven to work with a simple set of test cases.

[0] https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FPageImages.git/47137e7ee671c89667d620bc04ac7649b1d9af96/ApiQueryPageImages.php#L31

Bug: T98791
Bug: T114417
Change-Id: I923e88dde3a8ced4921b4192d90b4f3dc4b19e7b
2015-10-05 13:24:00 +01:00
Legoktm 1690d99e36 Revert "Include foreign files in ApiQueryPageImages"
Fatal error: Invalid operand type was used: cannot perform this operation with arrays

This reverts commit 47137e7ee6.

Bug: T114417
Change-Id: I89a2bfd69775a698f3000f48ea85465e193fb095
2015-10-01 21:23:23 +00:00
Sam Smith 47137e7ee6 Include foreign files in ApiQueryPageImages
Titles that correspond to foreign files aren't included in the set of
titles returned by ApiPageSet#getGoodTitles. However, since
ApiQueryPageImages#execute finds files with wfFindFile, these "missing"
titles can be included.

Add the ApiQueryPageImages#getTitles helper function, which returns the
set of "good" titles union the set of missing titles in the File
namespace.

Bug: T98791
Change-Id: I6ef9a925c749ed6c830c0ff9bb824753df65740a
2015-10-01 10:43:12 +01:00
YuviPanda e1786ece26 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
2015-04-03 19:13:55 +00:00
YuviPanda c4837a8eaf Add 'source' parameter to API for getting original url
Bug: T94928
Change-Id: I3bb8fb39385d8d6aec2504f121c684205ea82067
2015-04-03 18:53:21 +00:00
Max Semenik eb4d48a1dc Kill profiling
Change-Id: I0de8e2e06f9bf6790dd9b8f9364e70ace1b7ac0a
2015-01-20 15:37:08 -08:00
Ricordisamoa 734532b939 Use defined() instead of constant()
To check for the existance of ApiBase::PARAM_HELP_MSG
while preventing warnings from being issued:
http://php.net/manual/en/function.constant.php#refsect1-function.constant-errors
https://www.mediawiki.org/wiki/Thread:Extension_talk:PageImages/Can%27t_find_constant_API_base

Same as Iceaf4e424cd929df7b3df46544844a4b0001f4d7.

Change-Id: I2c83ed1c508ac837536dd0d21d4938296ad6ba03
2014-12-25 04:15:52 +01:00
Brad Jorsch a9e4c40fe5 Add i18n for API module help
MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
2014-10-29 16:37:38 -04:00
addshore 3240c37efe Remove use of deprecated getPossibleErrors (since 1.24)
Change-Id: I03385d1f239163c60f820cd9936ee384b37b9031
2014-08-29 12:12:47 +01:00
Max Semenik 195615137e Make sure that thumbnail size is not overreported
Bug: 64661
Change-Id: Iece32c7875dc2e66f0f221649e7dc9c860451c07
2014-06-12 15:18:44 -07:00
Max Semenik 863affef3d Make results cacheable
Change-Id: I836c15221c043be2c73a4c77b572a0fc52f01b82
2014-04-01 02:15:47 +04:00
Max Semenik c2a6ce8cdf Fix parameter description to match the actual behavior
Change-Id: I4329fa7232953d3eed3e6da5bfbada64eca49572
2013-12-10 18:12:36 +04:00
Max Semenik 486a8e68e6 Add a function to return a single page image
Change-Id: I3e891ee65476eb72b5ffd65d9af3ac1f080d849e
2013-11-06 00:18:14 +04:00
kaldari cb9f88263f PageImages on File namespace should be the file itself
When requesting the image info for a File namespace page we should
just use the file itself rather than searching for a page_image.

Bug: 50252
Change-Id: Ide250d489a1ceedd7e896a3b44471752f0971fb1
2013-07-09 11:52:15 -07:00
Max Semenik bd4ddfa90b Throw away everything not needed per our current requirements
Due to vastness of rewrite, recommend whole extension review instead of
reading diffs.

Change-Id: Ia50869d68b8796be9c95d0783f3f7adb71fdc2df
2012-12-21 12:40:47 +04:00
Max Semenik 32bc6cc0d2 Rewrite to support more precise search than just for presence/absence of pics
Pageset 2: fix minor stuff from CR

Change-Id: I6c0fa563a791c5fec82755beb695af74edd6c040
2012-07-20 00:51:16 +04:00
Max Semenik c1dcabeee2 Extend OpenSearchXml with image information 2012-03-08 18:01:00 +04:00
Max Semenik 941b84e967 roughly finished 2012-03-06 01:37:06 +04:00
Max Semenik 3665cab034 getParamDescription() 2012-03-01 23:55:02 +04:00
Max Semenik 65e098e79c API fixes 2012-03-01 23:44:37 +04:00
Max Semenik 703e6ef8a9 API module 2012-03-01 21:37:16 +04:00