Page MenuHomePhabricator

SpecialRecentChangesFilters hook is not executed for feeds
Closed, ResolvedPublic


When using the SpecialRecentChangesFilters [1] and SpecialRecentChangesQuery [2] hooks to enhance the recent changes, the former is never called when recent changes are displayed as a feed. This can cause exceptions when trying to access the value of filter options in the query hook.

In SpecialRecentChanges::getOptions [3] a special setup method for feeds is called when a feed output was requested. It seems that this was previously done to have some better caching for feeds; that however was removed later [4]. In any way, there is not much difference to the normal setup method, except that custom filters [5] are not added.

Nothing in the hook descriptions however suggests that this is the case, and given that the hook is the only way to modify the default options [6], I strongly suggest that the custom filters are added in the feedSetup method as well.

And at that point, merging the two setup functions should be considered. The only thing that really differs then would be the feed limit—which can be just respected by doing the check with $isFeed inside the setup method—and that subpage behavior which is not triggered anyway when no parameters are passed to the setup function.

In any way, not adding the custom filters in the feed setup breaks the extension setup and requires a further check inside the SpecialRecentChangesQuery hook handler to ensure that the option exists. I.e. something like this:

if (!$opts->validateName('optionname')) {
    global $wgDefaultUserOptions;
    $opts->add('optionname', $wgDefaultUserOptions['rcoptionname']);


Version: 1.23.0
Severity: normal



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:20 AM
bzimport set Reference to bz57201.

Change 96070 had a related patch set uploaded by Poke:
Integrate feed-specific setup into general setup

Change 96070 merged by jenkins-bot:
Integrate feed-specific setup into general setup