Page MenuHomePhabricator

Enabling LocalisationUpdate extension in initial MediaWiki setup raises exception
Closed, ResolvedPublic

Description

Author: codedriller

Description:
Enabling this extension in initial MediaWiki setup (1.22.0 on Windows) raises the following exception when trying to access main page for the first time:

[9215b846] /w22/index.php Exception from line 549 of C:\xampp\htdocs\w22\extensions\LocalisationUpdate\LocalisationUpdate.class.php: No cache directory configured

Backtrace:

#0 C:\xampp\htdocs\w22\extensions\LocalisationUpdate\LocalisationUpdate.class.php(561): LocalisationUpdate::filename(string)
#1 C:\xampp\htdocs\w22\extensions\LocalisationUpdate\LocalisationUpdate.class.php(36): LocalisationUpdate::readFile(string)
#2 [internal function]: LocalisationUpdate::onRecache(LocalisationCache, string, array)
#3 C:\xampp\htdocs\w22\includes\Hooks.php(199): call_user_func_array(string, array)
#4 C:\xampp\htdocs\w22\includes\GlobalFunctions.php(3877): Hooks::run(string, array)
#5 C:\xampp\htdocs\w22\includes\cache\LocalisationCache.php(853): wfRunHooks(string, array)
#6 C:\xampp\htdocs\w22\includes\cache\LocalisationCache.php(442): LocalisationCache->recache(string)
#7 C:\xampp\htdocs\w22\includes\cache\LocalisationCache.php(365): LocalisationCache->initLanguage(string)
#8 C:\xampp\htdocs\w22\includes\cache\LocalisationCache.php(281): LocalisationCache->loadSubitem(string, string, string)
#9 C:\xampp\htdocs\w22\languages\Language.php(2337): LocalisationCache->getSubitem(string, string, string)
#10 C:\xampp\htdocs\w22\includes\cache\MessageCache.php(802): Language->getMessage(string)
#11 C:\xampp\htdocs\w22\includes\cache\MessageCache.php(729): MessageCache->getMessageFromFallbackChain(LanguageRu, string, string, boolean)
#12 C:\xampp\htdocs\w22\includes\Message.php(878): MessageCache->get(string, boolean, LanguageRu)
#13 C:\xampp\htdocs\w22\includes\Message.php(560): Message->fetchMessage()
#14 C:\xampp\htdocs\w22\includes\Message.php(649): Message->toString()
#15 C:\xampp\htdocs\w22\includes\Title.php(375): Message->text()
#16 C:\xampp\htdocs\w22\includes\Wiki.php(121): Title::newMainPage()
#17 C:\xampp\htdocs\w22\includes\Wiki.php(137): MediaWiki->parseTitle()
#18 C:\xampp\htdocs\w22\includes\Wiki.php(530): MediaWiki->getTitle()
#19 C:\xampp\htdocs\w22\includes\Wiki.php(467): MediaWiki->main()
#20 C:\xampp\htdocs\w22\index.php(49): MediaWiki->run()
#21 {main}

Setting $wgCacheDirectory manually resolves the situation.


Version: unspecified
Severity: major
OS: Windows 7

Details

Reference
bz59614

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:42 AM
bzimport set Reference to bz59614.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for reporting this.

(In reply to comment #0)

Enabling this extension in initial MediaWiki setup (1.22.0 on Windows)

I assume you also use the REL1_22 branch of the extension? Or git master?

Setting $wgCacheDirectory manually resolves the situation.

Does that mean that $wgCacheDirectory was not set (empty) before?

codedriller wrote:

I used extension version bundled with MediaWiki 1.22.0 public download package.

$wgCacheDirectory was empty. There was no messages about undefined variables, so it was defined, but empty. As you can see, this exception is thrown when both $wgLocalisationUpdateDirectory and $wgCacheDirectory are empty.

line 549 of LocalisationUpdate.class.php:

$dir = $wgLocalisationUpdateDirectory ?

$wgLocalisationUpdateDirectory :
$wgCacheDirectory;

if ( !$dir ) {

throw new MWException( 'No cache directory configured' );

}

I had this error to and I found the solution:

I'm using MW 1.22.1 that I downloaded today, and got the same error.

According to it's extension page ([[mediawiki:Extension:LocalisationUpdate]]), you only need to add the following code in the LocalSettings.php

$wgLocalisationUpdateDirectory = "$IP/cache";

Second try: [[mw:Extension:LocalisationUpdate]]

  • This bug has been marked as a duplicate of bug 46885 ***