diff options
author | Matthias Mullie <git@mullie.eu> | 2022-08-31 16:51:57 +0200 |
---|---|---|
committer | Matthias Mullie <mmullie@wikimedia.org> | 2022-10-03 10:52:50 +0000 |
commit | c4a36b002329aeb50280b4cd2c3beb4697eb5988 (patch) | |
tree | c6bd52f6dbf08b3d24a9175d575546e8962dfb90 /includes/config-vars.php | |
parent | 6efeeb3c7ef1cb56babeb810ba7bd0799c62e0ab (diff) | |
download | mediawikicore-c4a36b002329aeb50280b4cd2c3beb4697eb5988.tar.gz mediawikicore-c4a36b002329aeb50280b4cd2c3beb4697eb5988.zip |
Introduce SearchResultThumbnailProvider & move hook + NS_FILE thumbs in
What was previously a REST API-only feature (the thumbnails
hook allowing for thumbnails for non-file pages via the
PageImages extension) is now also being adopted in the main
search page.
That hook will now be called with NS_FILE result thumbnails
pre-filled, which was not the case previously. PageImages
essentially duplicated NS_FILE thumbnail logic that was
already present in Special:Search, so that can (and will
in a follow-up patch) then be removed there. Special:Search
will then simply take whatever is produced from the provider
(which will include both NS_FILE thumbs - which it handled
already - as well as whatever else it receives from the hook),
as will the REST API (which already received both)
Since thumbnails can now come in for multiple namespaces &
having some of those results with & others without a thumbnail
can be quite jarring, it was decided that we'd display
placeholder images (for certain namespaces). This is now
controlled by $wgThumbnailNamespaces.
I also split up a few things in FullSearchResultWidget::
generateFileHtml for more clarity.
Meanwhile also updated mediawiki.special.search.styles.less
to use variables for known colors.
Also implemented a 'transform' (required for testing this
change properly) and 'getDisplayWidthHeight' (it became
needed after implementing transform) callback function for
mock Files, and updated some existing tests in response to
these changes.
And some more Rest test files have been updated to allow
passing around a HookContainer instead of only an array of
hooks (from which a new HookContainer would then be created)
to allow the same container to be used across all relevant
objects, who may have it injected as dependency.
Bug: T306883
Change-Id: I2a679b51758020d3e822da01a1bde1ae632b0b0a
Diffstat (limited to 'includes/config-vars.php')
-rwxr-xr-x[-rw-r--r--] | includes/config-vars.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/config-vars.php b/includes/config-vars.php index fbcaff3baddd..63972925c907 100644..100755 --- a/includes/config-vars.php +++ b/includes/config-vars.php @@ -767,6 +767,12 @@ $wgImageLimits = null; $wgThumbLimits = null; /** + * Config variable stub for the ThumbnailNamespaces setting, for use by phpdoc and IDEs. + * @see MediaWiki\MainConfigSchema::ThumbnailNamespaces + */ +$wgThumbnailNamespaces = null; + +/** * Config variable stub for the ThumbnailBuckets setting, for use by phpdoc and IDEs. * @see MediaWiki\MainConfigSchema::ThumbnailBuckets */ |