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
Fatal error: Invalid operand type was used: cannot perform this operation with arrays
This reverts commit 47137e7ee6.
Bug: T114417
Change-Id: I89a2bfd69775a698f3000f48ea85465e193fb095
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
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
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
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