jenkins-bot has submitted this change and it was merged.
Change subject: Regression: Remove Echo button from Nearby page / anon page
views
......................................................................
Regression: Remove Echo button from Nearby page / anon page views
This shouldn't be here. Broken in profile change.
(I59ed57fcd2c75788f42d6d306cba81719c964204)
Change-Id: I12dfe25e9a0fc40fef319acaf2591d8821d2f3e3
---
M includes/skins/SkinMinerva.php
M includes/specials/SpecialNearby.php
2 files changed, 9 insertions(+), 3 deletions(-)
Approvals:
JGonera: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 124ae0b..794d827 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -25,10 +25,10 @@
* @param $tpl BaseTemplate
*/
protected function prepareUserButton( BaseTemplate $tpl ) {
- if ( class_exists( 'MWEchoNotifUser' ) ) {
- $user = $this->getUser();
+ $user = $this->getUser();
+ if ( class_exists( 'MWEchoNotifUser' ) && $user->isLoggedIn() )
{
// FIXME: cap higher counts
- $count = $user->isLoggedIn() ?
MWEchoNotifUser::newFromUser( $user )->getNotificationCount() : 0;
+ $count = MWEchoNotifUser::newFromUser( $user
)->getNotificationCount();
$tpl->set( 'secondaryButton',
Html::openElement( 'a', array(
diff --git a/includes/specials/SpecialNearby.php
b/includes/specials/SpecialNearby.php
index 39159da..33a8e2a 100644
--- a/includes/specials/SpecialNearby.php
+++ b/includes/specials/SpecialNearby.php
@@ -16,6 +16,12 @@
// set config
$output->addJsConfigVars( 'wgMFNearbyRange', $wgMFNearbyRange );
+ $skin = $this->getSkin();
+ if ( method_exists( $skin, 'setTemplateVariable' ) ) {
+ // remove the Echo button to make way for a refresh
button
+ $this->getSkin()->setTemplateVariable(
'secondaryButton', '' );
+ }
+
// add previews to mobile only
$ctx = MobileContext::singleton();
if ( $ctx->shouldDisplayMobileView() &&
$ctx->isBetaGroupMember() ) {
--
To view, visit https://gerrit.wikimedia.org/r/85909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I12dfe25e9a0fc40fef319acaf2591d8821d2f3e3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits