aude created this task. aude added projects: Wikidata, MediaWiki-extensions-WikibaseMediaInfo. Herald added a subscriber: Aklapper. |
TASK DESCRIPTION
We need to allow a wiki to have multiple repos (repo to itself, such as for structured commons but the wiki would also still be a client of Wikidata).
Currently we set the wbRepo js config variable and use it to build api urls for making api requests. It default to the repoUrl (client setting) if it is set. In some cases we need that, and in other cases the api requests should be to itself (own wiki)
public function getScript( ResourceLoaderContext $context ) { global $wgServer, $wgScriptPath, $wgArticlePath; $settings = Settings::singleton(); if ( $settings->hasSetting( 'repoUrl' ) ) { // We're on a client (or at least the client configuration is available) $wbRepo = array( 'url' => $settings->getSetting( 'repoUrl' ), 'scriptPath' => $settings->getSetting( 'repoScriptPath' ), 'articlePath' => $settings->getSetting( 'repoArticlePath' ) ); } else { // Client configuration isn't available... just assume we're the repo $wbRepo = array( 'url' => $wgServer, 'scriptPath' => $wgScriptPath, 'articlePath' => $wgArticlePath ); } return Xml::encodeJsCall( 'mediaWiki.config.set', array( 'wbRepo', $wbRepo ) ); }
TASK DETAIL
EMAIL PREFERENCES
To: aude
Cc: aude, Aklapper, D3r1ck01, Izno, Wikidata-bugs, Ricordisamoa, Mbch331
Cc: aude, Aklapper, D3r1ck01, Izno, Wikidata-bugs, Ricordisamoa, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs