Topic on Extension talk:QuickInstantCommons

Nicole Sharp (talkcontribs)

Accessing "[[special:specialpages]]" when both InstantCommons and QuickInstantCommons are enabled produces the following error message:

"Internal error: [ZB4h8wFwXxIU-rLZVpSjQQAAAAE] 2023-03-24 22:19:32: Fatal exception of type 'LogicException'".

What I think happened is that I had MediaWiki initially configured with InstantCommons disabled and QuickInstantCommons enabled, using "$wgForeignFileRepos" to access content from Wikimedia Commons. I then disabled "$wgForeignFileRepos" for Wikimedia Commons and enabled InstantCommons instead, which apparently broke the QuickInstantCommons extension. I'll leave the configuration to use "$wgForeignFileRepos" instead of InstantCommons for accessing Wikimedia Commons content, but this appears to be a bug with QuickInstantCommons that prevents switching back and forth between InstantCommons and "$wgForeignFileRepos" for accessing Wikimedia Commons content. I am using MediaWiki 1.39.2 with PHP 8.2.0.

Nicole Sharp (talk) 22:28, 24 March 2023 (UTC)

Bawolff (talkcontribs)

Its kind of unclear what you did here, but if you are using both [normal] instant commons and QuickInstantCommons, at least one of them has to be setup via $wgForeignFileRepos (Doesn't matter which, could be both), and the two of them have to have separate repo names. If you are setting one up with $wgForeignFileRepos you must ensure the repo name you chose is different from the repo name that is automatically setup for the other one.

If you use the same repo name in $wgForeignFileRepos for more than one foreign file repo, an error will be generated (Potentially this one, but set $wgShowExceptionDetails = true; to be sure).

Nicole Sharp (talkcontribs)

Below is the syntax from "LocalSettings.php" that produces the error. InstantCommons is enabled but the "ForeignFileRepos" for Wikimedia Commons is disabled. Disabling InstantCommons and un-commenting "ForeignFileRepos" for Wikimedia Commons resolves the error.

# To enable image uploads, make sure the "images" directory is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

## https://www.mediawiki.org/wiki/manual:$wgUploadDirectory
$wgUploadDirectory = "{$IP}/uploads";
## https://www.mediawiki.org/wiki/manual:$wgUploadPath
$wgUploadPath = "$wgScriptPath/uploads";

# InstantCommons allows wiki to use images from: https://commons.wikimedia.org/
$wgUseInstantCommons = true;
## https://www.mediawiki.org/wiki/InstantCommons

# https://www.mediawiki.org/wiki/Extension:QuickInstantCommons
wfLoadExtension( 'QuickInstantCommons' );

# https://www.mediawiki.org/wiki/Manual:$wgForeignFileRepos#Usage

# $wgForeignFileRepos[] = [
# 'class' => ForeignAPIRepo::class,
# 'name' => 'commonswiki', # Must be a distinct name.
# 'apibase' => 'https://commons.wikimedia.org/w/api.php',
# 'hashLevels' => 2,
# 'fetchDescription' => true, # Optional.
# 'descriptionCacheExpiry' => 43200, # 12 hours, optional (values are seconds).
# 'apiThumbCacheExpiry' => 86400, # 24 hours, optional, but required for local thumb caching.
# ];

$wgForeignFileRepos[] = [
'class' => ForeignAPIRepo::class,
'name' => 'enwikipedia',
'apibase' => 'https://en.wikipedia.org/w/api.php',
'hashLevels' => 2,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
];

Nicole Sharp (talk) 00:18, 25 March 2023 (UTC)

Bawolff (talkcontribs)

This is covered on the extension page. If you want to use both you need to use the settings mentioned in the Advanced Configuration section.

Bawolff (talkcontribs)

err nevermind, i thought the docs had something about this, but i guess it does not.

Bawolff (talkcontribs)

Anyways this is expected behaviour, if you need to use both at the same time (probably not a good idea) use the settings suggested in the advanced configuration section.

Reply to "Logic Exception"