Skip to content

SLOP-393: replace removed MWNamespace class; drop dead page_counter reference - #7

Open
tosfos wants to merge 1 commit into
masterfrom
SLOP-393-mwnamespace-pagecounter
Open

SLOP-393: replace removed MWNamespace class; drop dead page_counter reference#7
tosfos wants to merge 1 commit into
masterfrom
SLOP-393-mwnamespace-pagecounter

Conversation

@tosfos

@tosfos tosfos commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Two MW-compat breakages fixed:

  1. includes/WatchAnalyticsPageTablePager.phpMWNamespace::getCanonicalNamespaces(): the MWNamespace class was removed in MediaWiki 1.39, so the Special:WatchAnalytics pages list (the default view) fatals. Replaced with MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalNamespaces() (same data, available since 1.34).
  2. includes/WatchAnalyticsParserFunctions.php — the {{#watchers_needed:}} query selected p.page_counter, a page table column removed in MediaWiki 1.25; every use died with Unknown column 'p.page_counter'. Dropped the view_watch_ratio computation (its data source no longer exists in core) and now ranks candidates by fewest watches — preserving the function's "pages that need watchers" purpose.

Verification

  • php -l clean on php:7.4-cli and php:8.2-cli for both files.
  • Live MariaDB check: old query shape fails with ERROR 1054 Unknown column 'p.page_counter'; new query shape executes and returns rows.
  • No remaining page_counter or MWNamespace references anywhere in the repo.

Closes SLOP-393.

…olumn

- MWNamespace::getCanonicalNamespaces() was removed in MW 1.39 and
  fatals the Special:WatchAnalytics pages list (default view); use
  NamespaceInfo::getCanonicalNamespaces() instead.
- The #watchers_needed query selected p.page_counter, a page-table
  column removed in MW 1.25, making the parser function fatal with an
  SQL error on every use. Drop the view_watch_ratio computation (the
  data source no longer exists) and rank by fewest watches instead,
  which preserves the function's purpose.
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4624f0d1-fa4e-4805-aa4d-80f5bc9f4ec5


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant