Merge "Always log a message when disableLocalTransform is hit"
This commit is contained in:
commit
b235bbab53
3 changed files with 13 additions and 6 deletions
|
|
@ -482,9 +482,10 @@ config-schema:
|
||||||
- thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
|
- thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
|
||||||
thumbProxyUrl
|
thumbProxyUrl
|
||||||
- disableLocalTransform
|
- disableLocalTransform
|
||||||
If present and true, local image scaling will be disabled -- it will
|
If present and true, local image scaling will be disabled. If attempted,
|
||||||
throw an exception if attempted. thumbProxyUrl must be set for this
|
it will show an error to the user and log an error message. To avoid an
|
||||||
to work, as well as either transformVia404 (preferred) or thumbScriptUrl.
|
error, thumbProxyUrl must be set, as well as either transformVia404
|
||||||
|
(preferred) or thumbScriptUrl.
|
||||||
- initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
|
- initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
|
||||||
determines whether filenames implicitly start with a capital letter.
|
determines whether filenames implicitly start with a capital letter.
|
||||||
The current implementation may give incorrect description page links
|
The current implementation may give incorrect description page links
|
||||||
|
|
|
||||||
|
|
@ -978,9 +978,10 @@ class MainConfigSchema {
|
||||||
* - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
|
* - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
|
||||||
* thumbProxyUrl
|
* thumbProxyUrl
|
||||||
* - disableLocalTransform
|
* - disableLocalTransform
|
||||||
* If present and true, local image scaling will be disabled -- it will
|
* If present and true, local image scaling will be disabled. If attempted,
|
||||||
* throw an exception if attempted. thumbProxyUrl must be set for this
|
* it will show an error to the user and log an error message. To avoid an
|
||||||
* to work, as well as either transformVia404 (preferred) or thumbScriptUrl.
|
* error, thumbProxyUrl must be set, as well as either transformVia404
|
||||||
|
* (preferred) or thumbScriptUrl.
|
||||||
* - initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
|
* - initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
|
||||||
* determines whether filenames implicitly start with a capital letter.
|
* determines whether filenames implicitly start with a capital letter.
|
||||||
* The current implementation may give incorrect description page links
|
* The current implementation may give incorrect description page links
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ use MediaWiki\Config\ConfigException;
|
||||||
use MediaWiki\Context\IContextSource;
|
use MediaWiki\Context\IContextSource;
|
||||||
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
|
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
|
||||||
use MediaWiki\Linker\LinkTarget;
|
use MediaWiki\Linker\LinkTarget;
|
||||||
|
use MediaWiki\Logger\LoggerFactory;
|
||||||
use MediaWiki\MainConfigNames;
|
use MediaWiki\MainConfigNames;
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
use MediaWiki\Page\PageIdentity;
|
use MediaWiki\Page\PageIdentity;
|
||||||
|
|
@ -1245,6 +1246,8 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
|
||||||
|
|
||||||
// Check to see if local transformation is disabled.
|
// Check to see if local transformation is disabled.
|
||||||
if ( !$this->repo->canTransformLocally() ) {
|
if ( !$this->repo->canTransformLocally() ) {
|
||||||
|
LoggerFactory::getInstance( 'thumbnail' )
|
||||||
|
->error( 'Local transform denied by configuration' );
|
||||||
$thumb = new MediaTransformError(
|
$thumb = new MediaTransformError(
|
||||||
wfMessage(
|
wfMessage(
|
||||||
'thumbnail_error',
|
'thumbnail_error',
|
||||||
|
|
@ -1281,6 +1284,8 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
|
||||||
->get( MainConfigNames::IgnoreImageErrors );
|
->get( MainConfigNames::IgnoreImageErrors );
|
||||||
|
|
||||||
if ( !$this->repo->canTransformLocally() ) {
|
if ( !$this->repo->canTransformLocally() ) {
|
||||||
|
LoggerFactory::getInstance( 'thumbnail' )
|
||||||
|
->error( 'Local transform denied by configuration' );
|
||||||
return new MediaTransformError(
|
return new MediaTransformError(
|
||||||
wfMessage(
|
wfMessage(
|
||||||
'thumbnail_error',
|
'thumbnail_error',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue