Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wikimedia\Rdbms\DBConnRef::fetchRow member function deprecated and removed #1

Open
djflux opened this issue Jan 24, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@djflux
Copy link
Owner

djflux commented Jan 24, 2023

While updating meza to MediaWiki 1.39 WatchAnalytics fails due to fetchRow() member function being deprecated as of MW 1.37 and removed in MW 1.39. Error from meza deploy monolith deployed via https://github.com/djflux/meza/tree/39.x-dev:

Original exception: [Y9BakrdH2Erz0KYQ1OOnTAAAAMI] /demo/index.php?title=Main_Page&requestDebug=1 Error: Call to undefined method Wikimedia\Rdbms\DatabaseMysqli::fetchRow()
Backtrace:
from /opt/htdocs/mediawiki/includes/libs/rdbms/database/DBConnRef.php(103)
#0 /opt/htdocs/mediawiki/extensions/WatchAnalytics/includes/UserWatchesQuery.php(122): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#1 /opt/htdocs/mediawiki/extensions/WatchAnalytics/Hooks.php(94): UserWatchesQuery->getUserWatchStats(User)
#2 /opt/htdocs/mediawiki/includes/HookContainer/HookContainer.php(338): WatchAnalyticsHooks::onBeforePageDisplay(OutputPage, MediaWiki\Skins\Vector\SkinVectorLegacy)
#3 /opt/htdocs/mediawiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#4 /opt/htdocs/mediawiki/includes/HookContainer/HookRunner.php(945): MediaWiki\HookContainer\HookContainer->run(string, array, array)

Code should use IResultWrapper::fetchRow() according to:

https://doc.wikimedia.org/mediawiki-core/REL1_38/php/classWikimedia_1_1Rdbms_1_1DBConnRef.html#a6619bdfd939800bedbb0c16c584b30ca

Working on fix.

@djflux djflux added the bug Something isn't working label Jan 24, 2023
@djflux djflux self-assigned this Jan 24, 2023
@djflux
Copy link
Owner Author

djflux commented Jan 26, 2023

All of these files have wfGetDB somewhere that needs to be updated like d07cb36

WatchAnalytics/WatchAnalyticsUser.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PageScore.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PageWatchesQuery.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PageWatchesQuery.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PageWatchesQuery.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PendingApproval.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/WatchAnalyticsParserFunctions.php:		$dbr = wfGetDB( DB_MASTER );
WatchAnalytics/includes/WatchAnalyticsParserFunctions.php:		$dbr = wfGetDB( DB_MASTER );
WatchAnalytics/includes/WatchAnalyticsTablePager.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/WatchAnalyticsTablePager.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/WatchStateRecorder.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/WatchStateRecorder.php:		$this->dbw = wfGetDB( DB_MASTER );
WatchAnalytics/includes/WatchStateRecorder.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/includes/WatchStateRecorder.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/includes/ReviewHandler.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/ReviewHandler.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/includes/WatchSuggest.php:		$this->dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PendingReview.php:			$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PendingReview.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/includes/PendingReview.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/maintenance/addCategoryToWatchlist.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/maintenance/forgivePendingReviews.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/specials/SpecialClearPendingReviews.php:		$dbw = wfGetDB( DB_MASTER );
WatchAnalytics/specials/SpecialPageStatistics.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/specials/SpecialWatchAnalytics.php:		// INNER JOIN page ON page.page_namespace = watchlist.wl_namespace AND page.page_title = watchlist.wl_title;		$dbr = wfGetDB( DB_SLAVE );
WatchAnalytics/specials/SpecialWatchAnalytics.php:		$dbr = wfGetDB( DB_REPLICA );
WatchAnalytics/Hooks.php:		$dbw = wfGetDB( DB_MASTER );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant