Commit graph

126 commits

Author SHA1 Message Date
Umherirrender 3703c048cc Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I780e57da1ea02eb333cf61abd999dc737acf20d1
2024-06-09 19:03:17 +02:00
jenkins-bot 6384abe012 Merge "Replace deprecated ApiPageSet::getGoodTitles" 2024-04-29 11:24:27 +00:00
Fomafix 6c80d95abe Use MainConfig instead of global variables
Use overrideConfigValue instead of setMwGlobals in tests.

Change-Id: Ifd7bd498bbb9a405afd9f6dd0e80540412b6ff93
2024-04-10 20:05:26 +00:00
Umherirrender beef358191 Replace deprecated ApiPageSet::getGoodTitles
Remove Title objects from the data provider and use PageReferences

Bug: T339384
Change-Id: I3ff14424c5caa9e4436dfe62052a6c95d30ac89f
2024-03-29 21:05:13 +00:00
Umherirrender bbb00c0f2d build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: Ied844c3ae930a03ca49e36e9a9e9d0c008d2634c
2024-03-11 20:13:21 +01:00
thiemowmde 903e1428c1 Use streamlined upstream createMock in PHPUnit tests
Change-Id: I3920819a97d05771f54687dab99ea9657371ac53
2024-02-08 12:08:17 +01:00
Umherirrender 15dbbe94d5 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Ie00aedfe607665e8a38ee4ce2475f25b82a1d8cf
2024-01-05 22:37:40 +01:00
Umherirrender 82654e0344 tests: Declare class property in ApiQueryPageImagesProxyMock
Creation of dynamic property
PageImages\Tests\ApiQueryPageImagesProxyMock::$pageSet is deprecated in
php8.2

Change-Id: I9ce28b6126638ff3b7bdca6cbc04080448aabc0c
2023-12-15 14:58:05 +01:00
jenkins-bot e5dc97bdfa Merge "Update tests for PHPUnit 9.6" 2023-11-30 23:08:21 +00:00
jenkins-bot 04eca18ed1 Merge "Use a return type hint for PageImages::getPageImageInternal()" 2023-11-30 10:36:46 +00:00
Daimona Eaytoy b7a537f72a Update tests for PHPUnit 9.6
- Avoid withConsecutive()

Bug: T342110
Change-Id: Ia7c60dd6789317b269d6b8641d6663c0905167e4
2023-11-27 18:20:53 +00:00
Amir Sarabadani 5ffaf34258 Add support for read new of pagelinks migration
Bug: T346457
Change-Id: I63ac37c2b73073e8e323f6627785955196cd148c
2023-11-01 18:51:38 +01:00
Fomafix 4b86859269 Use a return type hint for PageImages::getPageImageInternal()
Now getPageImageInternal returns null instead of false.

Fix the comment in fetchPageImage(): false means no cache.

Also add a return type hint to PageImages::factory().

Change-Id: I696f24390be530e7eea21957e0e46752d1bb3030
2023-10-21 13:06:16 +00:00
jenkins-bot 421e55b852 Merge "Inject service RepoGroup in APIPropModules" 2023-10-16 03:18:32 +00:00
Fomafix 21fdd8a9db Inject service RepoGroup in APIPropModules
Change-Id: Ifa1334391af08f09908a92f0a9b7774eda58c399
2023-10-15 20:17:05 +00:00
Fomafix 318407932c Replace deprecated global function wfGetDB()
Bug: T330641
Change-Id: If0427da7a6d2de9d1ec00bf1ff7e5b8a495617e9
2023-10-15 18:50:46 +00:00
Fomafix 029af825a9 Inject service RepoGroup in PageImages
Change-Id: I91d12fe25fbd6ee952d635cd24b5047be8790c80
2023-10-15 18:33:00 +00:00
Fomafix 1f95b141a6 Convert PageImages::fetchPageImage to a nonstatic method
The public static function PageImages::getPageImage must stay unchanged
because this function is called by other extensions.

Change-Id: I73f7253581ebc894ef6dcd41bd4713f7d9f53421
2023-10-15 18:21:40 +00:00
jenkins-bot aef7d17348 Merge "Use namespaced MediaWiki\Request\FauxRequest" 2023-08-20 01:07:09 +00:00
Umherirrender b8dd616a03 Use namespaced MediaWiki\Request\FauxRequest
Bug: T321681
Change-Id: I9c6b8bfc935a47c62c3e106a1bf4532ef4d12134
2023-08-20 01:54:45 +02:00
Umherirrender ec4d1bed4d Use namespaced MediaWiki\Page\PageProps
Bug: T321681
Change-Id: I5298c09e2869a21e6616cb6e8917da51177c7987
2023-08-20 01:21:38 +02:00
Umherirrender 0f44aa4b05 Use namespaced Title
Bug: T321681
Change-Id: Id8e166fd8a54ee84500a67d8729ca6562f003be5
2023-08-19 20:18:00 +02:00
gerritbot a85ae32a5e Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I80f2f9cdd569d549de8b403226000bb5c88fcb67
2023-08-19 04:18:19 +00:00
Umherirrender 619d623104 ParserFileProcessing: Inject TitleFactory
Check the parsed title if valid and can exists on the database

Change-Id: I32805de6ab4b9dca7d56faf982762f6949fc3203
2023-06-21 23:03:44 +02:00
Umherirrender a9b4b4877f ParserFileProcessing: Use ConnectionProvider and QueryBuilder
Bug: T312501
Change-Id: I4c5b5b773cbf1bf77dae7c189f65c8760091e384
2023-06-21 22:50:19 +02:00
Umherirrender e46bda7e67 tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: If55e19c0a088aef8ab84a09c8f1949320d035db4
2023-05-20 17:29:11 +02:00
jenkins-bot 3dfd1f636f Merge "Replace deprecated Http::get" 2022-12-14 20:50:00 +00:00
Amir Sarabadani 491eeedc28 Fix brittle test
It really shouldn't test everything. Blocking I3dc682d2dce

Change-Id: I12643edfad16acb072757ec29ae3ba08fc11d65b
2022-12-12 08:28:37 +01:00
Umherirrender de7bf883d2 Replace deprecated Http::get
Bug: T305813
Change-Id: Icd3e64fc13e291761b287c4059315df39cd88d1e
2022-12-11 15:54:20 +01:00
jenkins-bot 9902ffb55c Merge "Remove size check" 2022-11-17 23:16:29 +00:00
Matthias Mullie c75b00d14d Ensure array is passed to getProperties
PageImages::getPropNames can return either array or string,
and PageProps::getProperties accepts both.
But the latter's return value will be different depending
on the type of input: with an array as input, the returned
array's values will be an associative array where the index
is the propname; with a string, it's just the propvalue.

This difference matters because the code below assumes an
array with propname keys.

Bug: T323152
Change-Id: I422951ec0cd5c651b32c65e88a557d49f2f22712
2022-11-16 09:33:37 +01:00
Matthias Mullie 9391a1f18c Remove size check
Size is not a useful (and thus far, unused) value that
is expensive to compute & we want to get rid of.

Let's not expect any particular value (or it even
existing) because that may not remain true for much longer.

Bug: T323125
Change-Id: I20d5c4358e225be7759ed38afb2267d6f811fa34
2022-11-15 18:39:22 +01:00
Matthias Mullie 5dcd4d13e2 Only provide free images for search purposes
Bug: T320661
Change-Id: Ic26e7e815365f6aa81b6fbfb464d0f41b80e4ae8
2022-11-10 13:26:56 +01:00
jenkins-bot 74ec9b8a18 Merge "Drop some code that now lives in core" 2022-10-03 11:30:52 +00:00
Matthias Mullie 6a6af45ab3 Drop some code that now lives in core
The default thumbnail size (SearchResultThumbnailProvider::THUMBNAIL_SIZE),
the code to build a SearchResultThumbnail object from a File object
(SearchResultThumbnailProvider::buildSearchResultThumbnailFromFile),
and the code that provides thumbnails from NS_FILE pages (now already
provided in the hook's $results param) have essentially been adopted
in core and no longer need to be handled here.

Also updated test to reflect that NS_FILE results will no longer be
provided by this extension (since core already provides them)

Depends-On: I2a679b51758020d3e822da01a1bde1ae632b0b0a
Change-Id: I2eafc8556022432929973755d8cd76010ea24f39
Bug: T306883
2022-09-27 10:46:14 +02:00
Umherirrender c24081b609 Inject services into hook handler
Remove the self creating of the handler and remove one deep from the
caller stack

Change-Id: Ie12ff77781f5ec6c74d9289a9812ec4f40c07d95
2022-09-03 00:15:57 +02:00
Sébastien Beyou 3ab47c1061 Add a parameter to deactivate OpenGraph meta tags
This can conflict with other extensions like SemanticMetaTags or
OpenGraphMeta.

Bug: T217307
Change-Id: Idfb006583edda8545b95609f047b2f301a9caa33
2022-08-20 09:43:57 +02:00
Kosta Harlan 8adbbf5b8c
SearchResultProvideThumbnailHookHandler: Simplify code
Bug: T312746
Change-Id: Iaf3f7f56129f488088f08f65657fa33f6a6e5851
2022-07-18 10:13:42 +02:00
Reedy 84861174bc Convert Hooks to HookHandlers
Bug: T271021
Change-Id: I6022e515cf65ec089c59fb56f6fde371dc9f0e12
2022-07-07 10:21:43 +00:00
gerritbot d0f26549f2 Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: Ie88e576d3a6dc61155f2b7f49e86a993c2577427
2022-04-04 00:32:20 +00:00
gerritbot c2ee690bdd Replace deprecated ApiBase::PARAM_ with IntegerDef ones
The rest of ApiBase::PARAM_  will be done in separate patches

Bug: T275455
Change-Id: Ia64fadade6a890827bfb2b220e430c16716e86f7
2022-04-03 22:16:07 +02:00
C. Scott Ananian 8d62412484 ParserOutput::getPageProperty() now returns null when key is missing.
The return value of ParserOutput::getPageProperty() has transitioned
to returning `null` instead of `false` when the page property is missing.

Bug: T301915
Depends-On: Iaa25c390118d2db2b6578cdd558f2defd5351d15
Change-Id: Ie746883bd14eb579b40390d5fe824a5c6f93fa1e
2022-02-16 18:37:52 -05:00
C. Scott Ananian e9b268827f Update uses of ParserOutput::getPageProperty() to handle new return value
The return value of ParserOutput::getPageProperty() will transition to
returning `null` instead of `false` when the page property is missing.

Bug: T301915
Change-Id: I383abb6b7dc5e96c0061af13957609f6e31a1065
2022-02-16 18:37:52 -05:00
Simon Legner 41f4165230 Allow editors control of the page image
- Exclude images with class=notpageimage

Bug: T301588
Change-Id: I15eb580f5047a414431a45acf4004344e01a5881
2022-02-14 18:53:57 +00:00
Tim Starling 768464d0f9 Identify lead images using a new parser hook instead of during LinksUpdate
I added ParserModifyImageHTML to core to make it easier for PageImages
to identify images in the lead section.

This also allows PageImages to stop writing to LinksUpdate properties.
It is one of only two extensions that do that.

Depends-On: I24528381e8d24ca8d138bceadb9397c83fd31356
Bug: T176520
Bug: T296895
Change-Id: I472f4a023969bfde6298eb56112c16d2ae842199
2022-01-04 14:19:32 +11:00
Roman Stolar 6b4da12fd6 Replace deprecated Content::getParserOutput call to new one ContentRenderer::getParserOutput
Bug: T287158
Change-Id: Ia537b3a496e48237d427ad61a6db6268f63c769e
2021-10-21 18:19:03 +03:00
Alexander Vorwerk 7b03392757 MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: I5a60221692f3538dd96651493fc8d392aaabdf85
2021-10-12 00:57:52 +02:00
jenkins-bot f908355d17 Merge "Add a configuration to provide the fallback of og:image" 2021-07-28 16:03:39 +00:00
libraryupgrader 2f4755e065 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: I314da8a48195e98aed3605f18e9d0eab516ba026
2021-07-23 05:46:22 +00:00
lens0021 d526653e3a
Add a configuration to provide the fallback of og:image
Makes the fallback image be used when there is no image on a page.

Bug: T256935
Change-Id: I0bc4d55b20cc37edf46cb984a9a68617e2b4a89f
2021-06-18 12:16:36 +09:00