Skip to content

SLOP-378: call fetchObject()/fetchRow() on result wrappers, not DB handles (removed in MW 1.39) - #8

Open
tosfos wants to merge 1 commit into
masterfrom
SLOP-378-resultwrapper-fetch
Open

SLOP-378: call fetchObject()/fetchRow() on result wrappers, not DB handles (removed in MW 1.39)#8
tosfos wants to merge 1 commit into
masterfrom
SLOP-378-resultwrapper-fetch

Conversation

@tosfos

@tosfos tosfos commented Aug 23, 2026

Copy link
Copy Markdown

Summary

IDatabase::fetchObject() and IDatabase::fetchRow() were removed in MediaWiki 1.39; select()/query() return an IResultWrapper which still exposes both methods. Eight live call sites still invoked them through the DB handle ($dbr->fetchRow( $res ), $dbr->fetchObject( $result )), fataling with Call to undefined method on MW 1.39:

  • WatchAnalyticsUser.php:33
  • includes/PendingReview.php:185,252
  • includes/UserWatchesQuery.php:122
  • includes/WatchAnalyticsParserFunctions.php:79,192
  • specials/SpecialPageStatistics.php:266
  • specials/SpecialWatchAnalytics.php:108

All rewritten to $res->fetchRow() / $result->fetchObject() — the same shape the other ~15 fetch sites in this codebase already use. One commented-out site updated for consistency.

Verification

  • php -l clean on php:7.4-cli and php:8.2-cli for all 7 touched files.
  • Harness: stubbed 1.39-style select() returning a result wrapper — OLD shape ($dbr->fetchRow($res)) fatals with Call to undefined method; NEW shape ($res->fetchRow()) iterates rows correctly.

Closes SLOP-378.

IDatabase::fetchObject() and IDatabase::fetchRow() were removed in
MW 1.39; select()/query() return IResultWrapper which still exposes
both. Calling them on the DB handle now fatals (Call to undefined
method). Rewritten the 8 live call sites to invoke the methods on the
result wrapper, matching every other site in the codebase.
@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: de09ea74-572b-4b57-a27d-6ecc6850950f


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