Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74569


Change subject: Fix breakage from Ie33446a2
......................................................................

Fix breakage from Ie33446a2

LQT was relying on the presence of a 'watchlist' key on the personal URLs array.
With Ie33446a2 this would no longer occur if the user had no 'viewmywatchlist' 
permission,
therefore the 'New messages' link would not appear at the top and a PHP Notice 
would be generated.

Change-Id: Icb81016da76911599c092a93cea3558d49d5293d
---
M classes/Hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/69/74569/1

diff --git a/classes/Hooks.php b/classes/Hooks.php
index 60f9e72..b788d1c 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -487,7 +487,11 @@
 
                $insertUrls = array( 'newmessages' => $newMessagesLink );
 
-               $personal_urls = wfArrayInsertAfter( $personal_urls, 
$insertUrls, 'watchlist' );
+               if ( in_array( 'watchlist', array_keys( $personal_urls ) ) ) { 
// User has viewmywatchlist permission
+                       $personal_urls = wfArrayInsertAfter( $personal_urls, 
$insertUrls, 'watchlist' );
+               } else {
+                       $personal_urls = wfArrayInsertAfter( $personal_urls, 
$insertUrls, 'preferences' );
+               }
 
                return true;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/74569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb81016da76911599c092a93cea3558d49d5293d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to