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

Not working on MediaWiki 1.43 ($wgRCFeeds not being modified) #151

Open
kirb opened this issue Jan 6, 2025 · 0 comments
Open

Not working on MediaWiki 1.43 ($wgRCFeeds not being modified) #151

kirb opened this issue Jan 6, 2025 · 0 comments

Comments

@kirb
Copy link

kirb commented Jan 6, 2025

Hi there! I don't know if this is the right place to file issues, but I wasn't able to find a project for DiscordRCFeed on Phabricator, only a repository.

There is an issue that results in DiscordRCFeed not working on either MW 1.43 (possibly also 1.42, but we upgraded straight from 1.41 to 1.43), or PHP 8.2 (upgraded from 8.1) - the MediaWikiServicesHook no longer overwrites the value stored in $wgRCFeeds. That results in the following exception, which also annoyingly means the RecentChanges row gets rolled back, breaking the feed entirely.

[exception] [cc56eb1e256c9413c68c1ac4] /api.php   InvalidArgumentException: RCFeeds must have a class set
#0 /var/www/html/includes/recentchanges/RecentChange.php(607): MediaWiki\RCFeed\RCFeed::factory(array)
#1 /var/www/html/includes/recentchanges/RecentChange.php(527): RecentChange->notifyRCFeeds()
#2 /var/www/html/includes/recentchanges/RecentChange.php(820): RecentChange->save()
#3 /var/www/html/includes/deferred/MWCallableUpdate.php(52): RecentChange::{closure}(string)
#4 /var/www/html/includes/deferred/DeferredUpdates.php(460): MediaWiki\Deferred\MWCallableUpdate->doUpdate()
#5 /var/www/html/includes/deferred/DeferredUpdates.php(204): MediaWiki\Deferred\DeferredUpdates::attemptUpdate(MediaWiki\Deferred\MWCallableUpdate)
#6 /var/www/html/includes/deferred/DeferredUpdates.php(291): MediaWiki\Deferred\DeferredUpdates::run(MediaWiki\Deferred\MWCallableUpdate)
#7 /var/www/html/includes/deferred/DeferredUpdatesScope.php(243): MediaWiki\Deferred\DeferredUpdates::MediaWiki\Deferred\{closure}(MediaWiki\Deferred\MWCallableUpdate, int)
#8 /var/www/html/includes/deferred/DeferredUpdatesScope.php(172): MediaWiki\Deferred\DeferredUpdatesScope->processStageQueue(int, int, Closure)
#9 /var/www/html/includes/deferred/DeferredUpdates.php(285): MediaWiki\Deferred\DeferredUpdatesScope->processUpdates(int, Closure)
#10 /var/www/html/includes/MediaWikiEntryPoint.php(674): MediaWiki\Deferred\DeferredUpdates::doUpdates()
#11 /var/www/html/includes/MediaWikiEntryPoint.php(496): MediaWiki\MediaWikiEntryPoint->restInPeace()
#12 /var/www/html/includes/MediaWikiEntryPoint.php(454): MediaWiki\MediaWikiEntryPoint->doPostOutputShutdown()
#13 /var/www/html/includes/MediaWikiEntryPoint.php(209): MediaWiki\MediaWikiEntryPoint->postOutputShutdown()
#14 /var/www/html/api.php(44): MediaWiki\MediaWikiEntryPoint->run()
#15 {main}
[DeferredUpdates] Deferred update 'MediaWiki\Deferred\MWCallableUpdate_RecentChange::notifyEdit' failed to run.
#0 /var/www/html/includes/recentchanges/RecentChange.php(607): MediaWiki\RCFeed\RCFeed::factory(array)
#1 /var/www/html/includes/recentchanges/RecentChange.php(527): RecentChange->notifyRCFeeds()
#2 /var/www/html/includes/recentchanges/RecentChange.php(820): RecentChange->save()
#3 /var/www/html/includes/deferred/MWCallableUpdate.php(52): RecentChange::{closure}(string)
#4 /var/www/html/includes/deferred/DeferredUpdates.php(460): MediaWiki\Deferred\MWCallableUpdate->doUpdate()
#5 /var/www/html/includes/deferred/DeferredUpdates.php(204): MediaWiki\Deferred\DeferredUpdates::attemptUpdate(MediaWiki\Deferred\MWCallableUpdate)
#6 /var/www/html/includes/deferred/DeferredUpdates.php(291): MediaWiki\Deferred\DeferredUpdates::run(MediaWiki\Deferred\MWCallableUpdate)
#7 /var/www/html/includes/deferred/DeferredUpdatesScope.php(243): MediaWiki\Deferred\DeferredUpdates::MediaWiki\Deferred\{closure}(MediaWiki\Deferred\MWCallableUpdate, int)
#8 /var/www/html/includes/deferred/DeferredUpdatesScope.php(172): MediaWiki\Deferred\DeferredUpdatesScope->processStageQueue(int, int, Closure)
#9 /var/www/html/includes/deferred/DeferredUpdates.php(285): MediaWiki\Deferred\DeferredUpdatesScope->processUpdates(int, Closure)
#10 /var/www/html/includes/MediaWikiEntryPoint.php(674): MediaWiki\Deferred\DeferredUpdates::doUpdates()
#11 /var/www/html/includes/MediaWikiEntryPoint.php(496): MediaWiki\MediaWikiEntryPoint->restInPeace()
#12 /var/www/html/includes/MediaWikiEntryPoint.php(454): MediaWiki\MediaWikiEntryPoint->doPostOutputShutdown()
#13 /var/www/html/includes/MediaWikiEntryPoint.php(209): MediaWiki\MediaWikiEntryPoint->postOutputShutdown()
#14 /var/www/html/api.php(44): MediaWiki\MediaWikiEntryPoint->run()
#15 {main}
[rdbms] MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::onRunUpdateFailed [0.107ms] database: ROLLBACK
[DeferredUpdates] DeferredUpdates::run: ended MediaWiki\Deferred\MWCallableUpdate_RecentChange::notifyEdit #1568, processing time: 0.0041851997375488

I was able to sidestep the problem by adding the following at the end of onMediaWikiServices( $service ):

$GLOBALS[ 'wgRCFeeds' ] = $feeds;

The code follows the advice given here, but the suggestion doesn't appear to work any more. Maybe this aspect of DiscordRCFeed needs to be rethought?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Status: To do
Development

No branches or pull requests

2 participants