Page MenuHomePhabricator

ConfigRegistry missing in extension.json
Closed, ResolvedPublicBUG REPORT

Description

Installed software:

Server: Ubuntu 18.04
Mediawiki: 1.31.2
PHP: 7.2
sabre/dav: 3.2.0

After installing the extension like described on github (https://github.com/wikimedia/mediawiki-extensions-WebDAV) and calling "https://<wiki-domain>/<scriptPath>/webdav.php" in browser.
The catch block in webdav.php throws an error.

ConfigException: No registered builder available for wg.

This happens because the config vars in extension.json are not registerd properly. The following lines need to be added to the extension.json (note the change from 'wg' to 'webdav'). (See: https://www.mediawiki.org/wiki/Manual:Configuration_for_developers)

	"ConfigRegistry": {
		"webdav": "GlobalVarConfig::newInstance"
	},

As an effect of renaming 'wg' to 'webdav' all occurances need to be refactored:

$config = \MediaWiki\MediaWikiServices::getInstance()
			->getConfigFactory()->makeConfig( 'wg' );

to

$config = \MediaWiki\MediaWikiServices::getInstance()
			->getConfigFactory()->makeConfig( 'webdav' );

The following files need to be refactored:

  • includes/Locks/Backend/WebDAVMediaWikiDBLockBackend.php
  • includes/WebDAVNamespacesCollection.php
  • includes/WebDAVPagesCollection.php
  • includes/WebDAVFilesCollection.php
  • includes/WebDAVFileFile.php
  • webdav.php

Event Timeline

Osnard triaged this task as High priority.
Osnard subscribed.

Change 521818 had a related patch set uploaded (by ItSpiderman; owner: ItSpiderman):
[mediawiki/extensions/WebDAV@master] Add extension config

https://gerrit.wikimedia.org/r/521818

@Sebastian.Schmid91: Thank you for opening this ticket.
The issue is resolved in the patch above

Change 521818 merged by jenkins-bot:
[mediawiki/extensions/WebDAV@master] Add extension config + remove global consts

https://gerrit.wikimedia.org/r/521818

@ItSpiderman: Is there more left to do here? If not, feel free to set the status of this task to resolved. Thanks!

@ItSpiderman: No reply, hence setting task status to "resolved". Please reopen if there is more to do in this task.