This allows to use floats in the $wgPageImagesScores configuration.
Before, decimal places have just been cut off with no warning. I find
this pretty unexpected. When I see the terminology "score" being used,
I always think of float values. I checked all the code that consumes
these scores (it is all internal to LinksUpdateHookHandler), and it's
all fine with floats. I don't see a reason to forcefully cut decimal
places off.
Bug: T212013
Change-Id: I0f1f0ea0865f07b3e58a2fc142dcd838eb687c97
This patch is motivated by Iad694e0.
* I rearranged the code a little bit to avoid a duplicate line of code.
* I added a ksort() and a comment explaining it.
* Additional tests demonstrate why the ksort() is needed.
* I had to refactor the tests a little bit to allow for more test cases
that have been missing before.
Bug: T212013
Change-Id: Ia96dc8c6cf57ddcea410a7300756d0013052ac79
Original image info is now a first-class output property, and the
'original' property of the 'thumbnail' object has been deprecated since
December 2016 (with an API warning provided since then when original image
info is requested). It should be safe to remove at this point.
(N.B. The 'original' property was an undocumented piprop before the format
update, and the legacy output likely sees little if any usage.)
Bug: T152163
Change-Id: I73b476f9e50c14f705a30e20bc836b8db371f5f0
The following sniffs are failing and were disabled:
* MediaWiki.Files.ClassMatchesFilename.NotMatch
* MediaWiki.Files.ClassMatchesFilename.WrongCase
* MediaWiki.Files.OneClassPerFile.MultipleFound
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
Change-Id: Ibb3e8fbef168f886d2385565df85015c08b2f02a
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: I3554682b5c8686299dc8cf23a3ec8c59514ff008
This tag is useless and does nothing without og:title and
og:description also being present, which is not the case
right now. A more complete patch should re-introduce all
three tags in one go.
It is also questionable if this tag belongs to this
extension, because it is explicitly said that the image is
an optional element of a Twitter card. og:title and
og:description are not optional. og:description would
probably be set by the TextExtract extension. This means
this Twitter card tag belongs more to TextExtracts and not
to PageImages.
This reverts commit 2e83a2c1dc.
Bug: T157145
Change-Id: I17ffe8f83d91156a79facb4c35b4a15ecc49f108
This is still only testing negative cases with no page image.
In addition this patch does sort all the hook handlers
alphabetically, and adds a missing PHPDoc block.
Bug: T51859
Change-Id: Iea65f2181dd3cac3ec2ceac191f002f74af3ec24
The maintenance script to populate free images has finished executing.
Follow-up on I1d35e965dc37c8c4ecdcc43313b3198e951e1978.
Bug: T152216
Change-Id: I32669e937efa6f5566eee582b911d170a32762e3
It's useful for API consumers to have the dimensions of the original
image so that they know the bounds within which they can safely rewrite
the thumb URL (bearing in mind the prerendered widths[1], in the case of
WMF wiki consumers).
This change adds an 'original' property to the page object, containing
the original image source URL along with its width and height, when
original image info is requested.
A warning is added when original image info is requested, noting the
format change and warning the consumer that the original image URL will
no longer be provided within the 'thumbnail' property in a future release.
[1] https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L17535
Bug: T152163
Change-Id: I9d937f73a974dfb099b93552405531464b8ad3ae
When $wgPageImagesLeadSectionOnly is true restrict
the scoring of page images to images in the lead section.
This results in an additional parse of the lead section of the
content, but this should only happen once after an edit
has occurred and is deferred.
If false all images will be considered as candidates for
the page image choice.
Note that the choice between modes is per site not by
request. This is intentional to avoid having to store 4
different properties respecting license and
article position. As a result when enabling or disabling
this switch on existing setups, there will be a transitional
period where pages previously parsed will show pageimages
as calculated by the previous value of this config variable.
Bug: T87336
Change-Id: I09bdae82515f6e93f5606553259f10b3a10e9eaa
Very few of these jobs seem to be finishing, due to some
replicas being so far behind we get DBReplicationWaitError
thrown, which causes the job to be restarted. Catch and log,
but don't stop processing because of it.
There is also a problem with jobs that blow out the memory limits,
but not sure what to do with that.
Change-Id: Idffcfad76936f5e62e9018c58f2cb57db35af4b8
Trying to run this script in the cluster fatals out due to memory
problems somewhat regularly. The --start option helps to restart
it where it fell down, but when trying to run against hundreds of
wiki's that is a one-off solution that makes ensuring everything is
actually visited a pain.
To try and isolate errors add an option to push the parsing into the
job queue. There is still the possibility to miss pages, but job queue
retries should take care of us for the most part. Attempts to keep
load down on the databases by making sure no more than a specified
number of jobs are queued/processing at a given time.
Bug: T152155
Change-Id: I3a4e3a415b2f03de0bb36ac0515241e950130fde
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