Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/WatchAnalyticsPageTablePager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct( $page, $conds, $filters = [] ) {
}

public function getQueryInfo() {
$namespaces = MWNamespace::getCanonicalNamespaces();
$namespaces = MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalNamespaces();

if ( $this->mQueryNamespace !== null
&& $this->mQueryNamespace >= 0
Expand Down
5 changes: 2 additions & 3 deletions includes/WatchAnalyticsParserFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public static function renderWatchersNeeded( &$parser, $frame, $args ) {
p.page_title AS page_title,
p.page_namespace AS page_namespace,
SUM( IF(w.wl_title IS NOT NULL, 1, 0) ) AS num_watches,
SUM( IF(w.wl_user = $wgUserId, 1, 0) ) AS wg_user_watches,
p.page_counter / SUM( IF(w.wl_title IS NOT NULL, 1, 0) ) AS view_watch_ratio
SUM( IF(w.wl_user = $wgUserId, 1, 0) ) AS wg_user_watches
FROM
watchlist AS w
LEFT JOIN page AS p ON
Expand All @@ -178,7 +177,7 @@ public static function renderWatchersNeeded( &$parser, $frame, $args ) {
GROUP BY
p.page_title, p.page_namespace
ORDER BY
view_watch_ratio DESC
num_watches ASC
) AS tmp
WHERE
num_watches <= $maxWatchers
Expand Down