Florian created this task.
Florian added a project: MediaWiki-extensions-WikibaseClient.
Herald added subscribers: PokestarFan, Aklapper.
Herald added a project: Wikidata.

TASK DESCRIPTION

This is more or less related to T137537, which could be silently fixed with fixing the task, however, I wanted to make sure, that the current implementation (described below) probably works for the specific cases and assumptions in Wikimedia wikis, but does not work for third-party wikis or wikis, which do not meet these assumptions.

Today I worked on getting the ContentTranslation extension up and running and started using the language links functionalities of Wikibase (the Wikibase installation exists for a long time already, but wasn't used for language links, as there was only one wiki with one language until now). During the evaluation and installation of these things, I found out, that Wikibase' LangLinkHandler has a very _specific_ assumption about what the interwiki link of a site might be (until T137537 is fixed). It simply removes the "wiki" or "wikitionary" part of the site_global_id and uses the remaining part as the interwiki link:

	public function getInterwikiCodeFromSite( Site $site ) {
		// FIXME: We should use $site->getInterwikiIds, but the interwiki ids in
		// the sites table are wrong currently, see T137537.
		$id = $site->getGlobalId();
		$id = preg_replace( '/(wiki\w*|wiktionary)$/', '', $id );
		$id = strtr( $id, [ '_' => '-' ] );
		if ( !$id ) {
			$id = $site->getLanguageCode();
		}
		return $id;
	}

https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/22c655666a651864674826be72c4f697d9281e6c/client/includes/LangLinkHandler.php#L399-L409

This might work very well for WIkimedia and Wikimedia-like wikis, however, it does not work for most of the other wikis. A site_global_key, which ends with wiki, like endroidwiki, will be treated as having an interwiki link of endroid, which is false, as the interwiki link for this wiki is only "en", which is also the prefix saved in the interwiki table of MediaWiki.

While I agree, that task T137537 needs to be fixed, I would ask for a workaround/temporary configuration, which allows wikis (like third-party wikis) to use getInterwikiIds of the Site class for the interwiki links, instead of this fuzzy assumption with the site global key.


TASK DETAIL
https://phabricator.wikimedia.org/T172076

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Florian
Cc: Aklapper, Florian, PokestarFan, GoranSMilovanovic, QZanden, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to