Page MenuHomeTelepedia

Use ConfigFactory in DynamicSettings
Open, Needs TriagePublic

Description

At the minute, DynamicSettings knows which wiki we're on via a request to $this->wgRequest->getVal('siteKey');, which is okay if we've arrived at the any of the special pages from the master wiki by clicking on the edit button. Otherwise, it will throw a "site not found" error if we go directly to Special:WikiSettings because we are not passing a parameter to the URL.

To fix this, it should be changed to get the site key from the config factory, as such:

$this->config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'dynamicsettings' );$siteKey = $this->config->get( 'DSSiteKey' );

Which would always give us the site key of the site we're currently viewing; this is defined in LocalSettings.php as $wgDSSiteKey which is a change from $dsSiteKey.