Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/57843
Change subject: Make sure to show edit link if no interwiki links, but page is connected ...................................................................... Make sure to show edit link if no interwiki links, but page is connected Change-Id: I310a6185b446cca5a253ca0b0d9d1b5ca94ab346 --- M client/WikibaseClient.hooks.php 1 file changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/43/57843/1 diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index ca235d2..ba8af23 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -425,15 +425,24 @@ if ( $namespaceChecker->isWikibaseEnabled( $title->getNamespace() ) ) { $out->addModules( 'wikibase.client.init' ); - if ( !$out->getLanguageLinks() && \Action::getActionName( $skin->getContext() ) === 'view' && $title->exists() ) { - // Module with the sole purpose to hide #p-lang - // Needed as we can't do that in the regular CSS nor in JavaScript - // (as that only runs after the element initially appeared). - $out->addModules( 'wikibase.client.nolanglinks' ); + $prefixedId = $out->getProperty( 'wikibase_item' ); + if ( $prefixedId === null && \Action::getActionName( $skin->getContext() ) === 'view' + && $title->exists() ) { - if ( Settings::get( 'enableSiteLinkWidget' ) === true && $user->isLoggedIn() === true ) { - // Add the JavaScript to link pages locally - $out->addModules( 'wbclient.linkItem' ); + $noExternalLangLinks = $skin->getOutput()->getProperty( 'noexternallanglinks' ); + + // @todo: may want a data link somewhere, even if the links are suppressed + if ( $noExternalLangLinks === null || !in_array( '*', $noExternalLangLinks ) ) { + + // Module with the sole purpose to hide #p-lang + // Needed as we can't do that in the regular CSS nor in JavaScript + // (as that only runs after the element initially appeared). + $out->addModules( 'wikibase.client.nolanglinks' ); + + if ( Settings::get( 'enableSiteLinkWidget' ) === true && $user->isLoggedIn() === true ) { + // Add the JavaScript to link pages locally + $out->addModules( 'wbclient.linkItem' ); + } } } } -- To view, visit https://gerrit.wikimedia.org/r/57843 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I310a6185b446cca5a253ca0b0d9d1b5ca94ab346 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits