Check if SpecialMobileWatchlist exist
If MobileFrontend doesn't exist this will throw an error Bug: T171241 Change-Id: Ie61cfa61b78a53598ac59aea15c8a4e6a261238d
This commit is contained in:
parent
f08b6defd7
commit
d5e09c91e9
|
@ -470,13 +470,16 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
|
|||
$watchlistQuery = [];
|
||||
$user = $this->getUser();
|
||||
if ( $user ) {
|
||||
$view = $user->getOption( SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
|
||||
$filter = $user->getOption( SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
|
||||
if ( $view ) {
|
||||
$watchlistQuery['watchlistview'] = $view;
|
||||
}
|
||||
if ( $filter && $view === 'feed' ) {
|
||||
$watchlistQuery['filter'] = $filter;
|
||||
// Avoid fatal when MobileFrontend not available (T171241)
|
||||
if ( class_exists( 'SpecialMobileWatchlist' ) ) {
|
||||
$view = $user->getOption( SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
|
||||
$filter = $user->getOption( SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
|
||||
if ( $view ) {
|
||||
$watchlistQuery['watchlistview'] = $view;
|
||||
}
|
||||
if ( $filter && $view === 'feed' ) {
|
||||
$watchlistQuery['filter'] = $filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue