Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
87.15% |
726 / 833 |
|
60.71% |
34 / 56 |
CRAP | |
0.00% |
0 / 1 |
| ChangesListSpecialPage | |
87.15% |
726 / 833 |
|
60.71% |
34 / 56 |
187.95 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getBaseFilterGroupDefinitions | |
100.00% |
320 / 320 |
|
100.00% |
1 / 1 |
2 | |||
| getExtraFilterGroupDefinitions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| execute | |
52.08% |
25 / 48 |
|
0.00% |
0 / 1 |
39.75 | |||
| setTempUserConfig | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| considerActionsForDefaultSavedQuery | |
39.39% |
13 / 33 |
|
0.00% |
0 / 1 |
27.03 | |||
| getLinkDays | |
45.45% |
5 / 11 |
|
0.00% |
0 / 1 |
6.60 | |||
| includeRcFiltersApp | |
95.56% |
43 / 45 |
|
0.00% |
0 / 1 |
6 | |||
| getViewableRestrictedChangeTags | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
2 | |||
| getRcFiltersConfigSummary | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 | |||
| getRcFiltersConfigVars | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthorityForPublicChangeTags | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| outputNoResults | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
| outputTimeout | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| getRows | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getQueryResult | |
70.00% |
7 / 10 |
|
0.00% |
0 / 1 |
4.43 | |||
| newRecentChangeFromRow | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getOptions | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getBaseFilterFactoryConfig | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
2 | |||
| getExtraFilterFactoryConfig | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getFilterDefaultOverrides | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getFilterFactory | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| registerFilters | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 | |||
| registerFiltersFromDefinitions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setup | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
2 | |||
| getDefaultOptions | |
100.00% |
15 / 15 |
|
100.00% |
1 / 1 |
1 | |||
| registerFilterGroup | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getFilterGroup | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStructuredFilterJsData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| fetchOptionsFromRequest | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| parseParameters | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
6 | |||
| validateOptions | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
3 | |||
| fixContradictoryOptions | |
66.67% |
4 / 6 |
|
0.00% |
0 / 1 |
4.59 | |||
| fixBackwardsCompatibilityOptions | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
4 | |||
| replaceOldOptions | |
100.00% |
24 / 24 |
|
100.00% |
1 / 1 |
7 | |||
| convertParamsForLink | |
80.00% |
4 / 5 |
|
0.00% |
0 / 1 |
3.07 | |||
| buildQuery | |
95.89% |
70 / 73 |
|
0.00% |
0 / 1 |
14 | |||
| modifyQuery | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| runMainQueryHook | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| addMainQueryHook | |
10.00% |
1 / 10 |
|
0.00% |
0 / 1 |
4.92 | |||
| getDB | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| webOutputHeader | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| webOutput | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| outputFeedLinks | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| outputChangesList | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| doHeader | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setTopText | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setBottomText | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getExtraOptions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| makeLegend | |
66.10% |
39 / 59 |
|
0.00% |
0 / 1 |
10.49 | |||
| addModules | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
3 | |||
| getGroupName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isStructuredFilterUiEnabled | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
| checkStructuredFilterUiEnabled | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getDefaultLimit | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getDefaultDays | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getLimitPreferenceName | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| getSavedQueriesPreferenceName | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| getDefaultDaysPreferenceName | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| getCollapsedPreferenceName | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| expandSymbolicNamespaceFilters | |
90.00% |
9 / 10 |
|
0.00% |
0 / 1 |
6.04 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | namespace MediaWiki\SpecialPage; |
| 8 | |
| 9 | use MediaWiki\Exception\MWExceptionHandler; |
| 10 | use MediaWiki\Html\FormOptions; |
| 11 | use MediaWiki\Html\Html; |
| 12 | use MediaWiki\Json\FormatJson; |
| 13 | use MediaWiki\MainConfigNames; |
| 14 | use MediaWiki\MediaWikiServices; |
| 15 | use MediaWiki\Parser\Sanitizer; |
| 16 | use MediaWiki\Permissions\Authority; |
| 17 | use MediaWiki\Permissions\SimpleAuthority; |
| 18 | use MediaWiki\RecentChanges\ChangesListBooleanFilterGroup; |
| 19 | use MediaWiki\RecentChanges\ChangesListFilterFactory; |
| 20 | use MediaWiki\RecentChanges\ChangesListFilterGroup; |
| 21 | use MediaWiki\RecentChanges\ChangesListFilterGroupContainer; |
| 22 | use MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery; |
| 23 | use MediaWiki\RecentChanges\ChangesListQuery\ChangesListQueryFactory; |
| 24 | use MediaWiki\RecentChanges\ChangesListQuery\ChangesListResult; |
| 25 | use MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup; |
| 26 | use MediaWiki\RecentChanges\RecentChange; |
| 27 | use MediaWiki\RecentChanges\RecentChangeFactory; |
| 28 | use MediaWiki\ResourceLoader as RL; |
| 29 | use MediaWiki\Title\MalformedTitleException; |
| 30 | use MediaWiki\User\TempUser\TempUserConfig; |
| 31 | use MediaWiki\User\UserArray; |
| 32 | use MediaWiki\User\UserIdentity; |
| 33 | use MediaWiki\User\UserIdentityUtils; |
| 34 | use MediaWiki\User\UserIdentityValue; |
| 35 | use OOUI\IconWidget; |
| 36 | use stdClass; |
| 37 | use Wikimedia\Rdbms\DBQueryTimeoutError; |
| 38 | use Wikimedia\Rdbms\IReadableDatabase; |
| 39 | use Wikimedia\Rdbms\IResultWrapper; |
| 40 | use Wikimedia\Timestamp\ConvertibleTimestamp; |
| 41 | use Wikimedia\Timestamp\TimestampFormat as TS; |
| 42 | |
| 43 | /** |
| 44 | * Special page which uses a ChangesList to show query results. |
| 45 | * |
| 46 | * @todo Most of the functions here should be protected instead of public. |
| 47 | * |
| 48 | * @ingroup RecentChanges |
| 49 | * @ingroup SpecialPage |
| 50 | */ |
| 51 | abstract class ChangesListSpecialPage extends SpecialPage { |
| 52 | |
| 53 | /** @var string */ |
| 54 | protected $rcSubpage; |
| 55 | |
| 56 | /** @var FormOptions */ |
| 57 | protected $rcOptions; |
| 58 | |
| 59 | protected ChangesListFilterGroupContainer $filterGroups; |
| 60 | |
| 61 | private ?ChangesListResult $queryResult = null; |
| 62 | |
| 63 | /** @var bool */ |
| 64 | private $mainQueryHookRegistered = false; |
| 65 | /** @var bool */ |
| 66 | private $mainQueryHookCalled = false; |
| 67 | |
| 68 | /** |
| 69 | * @param string $name |
| 70 | * @param UserIdentityUtils $userIdentityUtils |
| 71 | * @param TempUserConfig $tempUserConfig |
| 72 | * @param RecentChangeFactory $recentChangeFactory |
| 73 | * @param ChangesListQueryFactory $changesListQueryFactory |
| 74 | */ |
| 75 | public function __construct( |
| 76 | $name, |
| 77 | protected readonly UserIdentityUtils $userIdentityUtils, |
| 78 | protected TempUserConfig $tempUserConfig, |
| 79 | protected readonly RecentChangeFactory $recentChangeFactory, |
| 80 | protected readonly ChangesListQueryFactory $changesListQueryFactory, |
| 81 | ) { |
| 82 | parent::__construct( $name ); |
| 83 | |
| 84 | $this->filterGroups = new ChangesListFilterGroupContainer(); |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Definitions for the filters and their groups. |
| 89 | * |
| 90 | * This is extended by overriding getExtraFilterGroupDefinitions() in |
| 91 | * subclasses. |
| 92 | * |
| 93 | * @see ChangesListFilterFactory::registerFiltersFromDefinitions() |
| 94 | * |
| 95 | * @return array |
| 96 | */ |
| 97 | private function getBaseFilterGroupDefinitions() { |
| 98 | return [ |
| 99 | [ |
| 100 | 'name' => 'registration', |
| 101 | 'title' => 'rcfilters-filtergroup-registration', |
| 102 | 'class' => ChangesListBooleanFilterGroup::class, |
| 103 | 'filters' => [ |
| 104 | [ |
| 105 | 'name' => 'hideliu', |
| 106 | // rcshowhideliu-show, rcshowhideliu-hide, |
| 107 | // wlshowhideliu |
| 108 | 'showHideSuffix' => 'showhideliu', |
| 109 | 'default' => false, |
| 110 | 'action' => [ 'exclude', 'named' ], |
| 111 | 'isReplacedInStructuredUi' => true, |
| 112 | ], |
| 113 | [ |
| 114 | 'name' => 'hideanons', |
| 115 | // rcshowhideanons-show, rcshowhideanons-hide, |
| 116 | // wlshowhideanons |
| 117 | 'showHideSuffix' => 'showhideanons', |
| 118 | 'default' => false, |
| 119 | 'action' => [ 'require', 'named' ], |
| 120 | 'isReplacedInStructuredUi' => true, |
| 121 | ] |
| 122 | ], |
| 123 | ], |
| 124 | |
| 125 | [ |
| 126 | 'name' => 'userExpLevel', |
| 127 | 'title' => 'rcfilters-filtergroup-user-experience-level', |
| 128 | 'class' => ChangesListStringOptionsFilterGroup::class, |
| 129 | 'isFullCoverage' => true, |
| 130 | 'filters' => [ |
| 131 | [ |
| 132 | 'name' => 'unregistered', |
| 133 | 'requireConfig' => [ 'isRegistrationRequiredToEdit' => false ], |
| 134 | 'label' => 'rcfilters-filter-user-experience-level-unregistered-label', |
| 135 | 'description' => $this->tempUserConfig->isKnown() ? |
| 136 | 'rcfilters-filter-user-experience-level-unregistered-description-temp' : |
| 137 | 'rcfilters-filter-user-experience-level-unregistered-description', |
| 138 | 'cssClassSuffix' => 'user-unregistered', |
| 139 | 'action' => [ 'require', 'experience', 'unregistered' ], |
| 140 | ], |
| 141 | [ |
| 142 | 'name' => 'registered', |
| 143 | 'requireConfig' => [ 'isRegistrationRequiredToEdit' => false ], |
| 144 | 'label' => 'rcfilters-filter-user-experience-level-registered-label', |
| 145 | 'description' => 'rcfilters-filter-user-experience-level-registered-description', |
| 146 | 'cssClassSuffix' => 'user-registered', |
| 147 | 'action' => [ 'require', 'experience', 'registered' ], |
| 148 | 'subsets' => [ 'newcomer', 'learner', 'experienced' ], |
| 149 | ], |
| 150 | [ |
| 151 | 'name' => 'newcomer', |
| 152 | 'label' => 'rcfilters-filter-user-experience-level-newcomer-label', |
| 153 | 'description' => 'rcfilters-filter-user-experience-level-newcomer-description', |
| 154 | 'cssClassSuffix' => 'user-newcomer', |
| 155 | 'action' => [ 'require', 'experience', 'newcomer' ], |
| 156 | ], |
| 157 | [ |
| 158 | 'name' => 'learner', |
| 159 | 'label' => 'rcfilters-filter-user-experience-level-learner-label', |
| 160 | 'description' => 'rcfilters-filter-user-experience-level-learner-description', |
| 161 | 'cssClassSuffix' => 'user-learner', |
| 162 | 'action' => [ 'require', 'experience', 'learner' ], |
| 163 | ], |
| 164 | [ |
| 165 | 'name' => 'experienced', |
| 166 | 'label' => 'rcfilters-filter-user-experience-level-experienced-label', |
| 167 | 'description' => 'rcfilters-filter-user-experience-level-experienced-description', |
| 168 | 'cssClassSuffix' => 'user-experienced', |
| 169 | 'action' => [ 'require', 'experience', 'experienced' ], |
| 170 | ] |
| 171 | ], |
| 172 | 'default' => ChangesListStringOptionsFilterGroup::NONE, |
| 173 | ], |
| 174 | |
| 175 | [ |
| 176 | 'name' => 'authorship', |
| 177 | 'title' => 'rcfilters-filtergroup-authorship', |
| 178 | 'class' => ChangesListBooleanFilterGroup::class, |
| 179 | 'filters' => [ |
| 180 | [ |
| 181 | 'name' => 'hidemyself', |
| 182 | 'label' => 'rcfilters-filter-editsbyself-label', |
| 183 | 'description' => 'rcfilters-filter-editsbyself-description', |
| 184 | // rcshowhidemine-show, rcshowhidemine-hide, |
| 185 | // wlshowhidemine |
| 186 | 'showHideSuffix' => 'showhidemine', |
| 187 | 'default' => false, |
| 188 | 'action' => [ 'exclude', 'user', $this->getUser() ], |
| 189 | 'highlight' => [ 'require', 'user', $this->getUser() ], |
| 190 | 'cssClassSuffix' => 'self', |
| 191 | ], |
| 192 | [ |
| 193 | 'name' => 'hidebyothers', |
| 194 | 'label' => 'rcfilters-filter-editsbyother-label', |
| 195 | 'description' => 'rcfilters-filter-editsbyother-description', |
| 196 | 'default' => false, |
| 197 | 'action' => [ 'require', 'user', $this->getUser() ], |
| 198 | 'highlight' => [ 'exclude', 'user', $this->getUser() ], |
| 199 | 'cssClassSuffix' => 'others', |
| 200 | ] |
| 201 | ] |
| 202 | ], |
| 203 | |
| 204 | [ |
| 205 | 'name' => 'automated', |
| 206 | 'title' => 'rcfilters-filtergroup-automated', |
| 207 | 'class' => ChangesListBooleanFilterGroup::class, |
| 208 | 'filters' => [ |
| 209 | [ |
| 210 | 'name' => 'hidebots', |
| 211 | 'label' => 'rcfilters-filter-bots-label', |
| 212 | 'description' => 'rcfilters-filter-bots-description', |
| 213 | // rcshowhidebots-show, rcshowhidebots-hide, |
| 214 | // wlshowhidebots |
| 215 | 'showHideSuffix' => 'showhidebots', |
| 216 | 'default' => false, |
| 217 | 'action' => [ 'exclude', 'bot' ], |
| 218 | 'highlight' => [ 'require', 'bot' ], |
| 219 | 'cssClassSuffix' => 'bot', |
| 220 | ], |
| 221 | [ |
| 222 | 'name' => 'hidehumans', |
| 223 | 'label' => 'rcfilters-filter-humans-label', |
| 224 | 'description' => 'rcfilters-filter-humans-description', |
| 225 | 'default' => false, |
| 226 | 'action' => [ 'require', 'bot' ], |
| 227 | 'highlight' => [ 'exclude', 'bot' ], |
| 228 | 'cssClassSuffix' => 'human', |
| 229 | ] |
| 230 | ] |
| 231 | ], |
| 232 | |
| 233 | // significance (conditional) |
| 234 | |
| 235 | [ |
| 236 | 'name' => 'significance', |
| 237 | 'title' => 'rcfilters-filtergroup-significance', |
| 238 | 'class' => ChangesListBooleanFilterGroup::class, |
| 239 | 'priority' => -6, |
| 240 | 'filters' => [ |
| 241 | [ |
| 242 | 'name' => 'hideminor', |
| 243 | 'label' => 'rcfilters-filter-minor-label', |
| 244 | 'description' => 'rcfilters-filter-minor-description', |
| 245 | // rcshowhideminor-show, rcshowhideminor-hide, |
| 246 | // wlshowhideminor |
| 247 | 'showHideSuffix' => 'showhideminor', |
| 248 | 'default' => false, |
| 249 | 'action' => [ 'exclude', 'minor' ], |
| 250 | 'highlight' => [ 'require', 'minor' ], |
| 251 | 'cssClassSuffix' => 'minor', |
| 252 | 'conflictOptions' => [ |
| 253 | 'globalKey' => 'rcfilters-hideminor-conflicts-typeofchange-global', |
| 254 | 'forwardKey' => 'rcfilters-hideminor-conflicts-typeofchange', |
| 255 | 'backwardKey' => 'rcfilters-typeofchange-conflicts-hideminor', |
| 256 | ], |
| 257 | 'conflictsWith' => [ |
| 258 | 'changeType' => [ |
| 259 | 'hidecategorization' => [], |
| 260 | 'hidelog' => [], |
| 261 | 'hidenewuserlog' => [], |
| 262 | 'hidenewpages' => [] |
| 263 | ], |
| 264 | ], |
| 265 | ], |
| 266 | [ |
| 267 | 'name' => 'hidemajor', |
| 268 | 'label' => 'rcfilters-filter-major-label', |
| 269 | 'description' => 'rcfilters-filter-major-description', |
| 270 | 'default' => false, |
| 271 | 'action' => [ 'require', 'minor' ], |
| 272 | 'highlight' => [ 'exclude', 'minor' ], |
| 273 | 'cssClassSuffix' => 'major', |
| 274 | ] |
| 275 | ] |
| 276 | ], |
| 277 | |
| 278 | [ |
| 279 | 'name' => 'lastRevision', |
| 280 | 'title' => 'rcfilters-filtergroup-lastrevision', |
| 281 | 'class' => ChangesListBooleanFilterGroup::class, |
| 282 | 'priority' => -7, |
| 283 | 'filters' => [ |
| 284 | [ |
| 285 | 'name' => 'hidelastrevision', |
| 286 | 'label' => 'rcfilters-filter-lastrevision-label', |
| 287 | 'description' => 'rcfilters-filter-lastrevision-description', |
| 288 | 'default' => false, |
| 289 | 'action' => [ |
| 290 | [ 'require', 'revisionType', 'old' ], |
| 291 | [ 'require', 'revisionType', 'none' ], |
| 292 | ], |
| 293 | 'highlight' => [ 'require', 'revisionType', 'latest' ], |
| 294 | 'cssClassSuffix' => 'last', |
| 295 | ], |
| 296 | [ |
| 297 | 'name' => 'hidepreviousrevisions', |
| 298 | 'label' => 'rcfilters-filter-previousrevision-label', |
| 299 | 'description' => 'rcfilters-filter-previousrevision-description', |
| 300 | 'default' => false, |
| 301 | 'action' => [ |
| 302 | [ 'require', 'revisionType', 'latest' ], |
| 303 | [ 'require', 'revisionType', 'none' ], |
| 304 | ], |
| 305 | 'highlight' => [ 'require', 'revisionType', 'old' ], |
| 306 | 'cssClassSuffix' => 'previous', |
| 307 | ] |
| 308 | ] |
| 309 | ], |
| 310 | |
| 311 | // With extensions, there can be change types that will not be hidden by any of these. |
| 312 | [ |
| 313 | 'name' => 'changeType', |
| 314 | 'title' => 'rcfilters-filtergroup-changetype', |
| 315 | 'class' => ChangesListBooleanFilterGroup::class, |
| 316 | 'priority' => -8, |
| 317 | 'filters' => [ |
| 318 | [ |
| 319 | 'name' => 'hidepageedits', |
| 320 | 'label' => 'rcfilters-filter-pageedits-label', |
| 321 | 'description' => 'rcfilters-filter-pageedits-description', |
| 322 | 'default' => false, |
| 323 | 'priority' => -2, |
| 324 | 'action' => [ 'exclude', 'source', RecentChange::SRC_EDIT ], |
| 325 | 'highlight' => [ 'require', 'source', RecentChange::SRC_EDIT ], |
| 326 | 'cssClassSuffix' => 'src-mw-edit', |
| 327 | ], |
| 328 | [ |
| 329 | 'name' => 'hidenewpages', |
| 330 | 'label' => 'rcfilters-filter-newpages-label', |
| 331 | 'description' => 'rcfilters-filter-newpages-description', |
| 332 | 'default' => false, |
| 333 | 'priority' => -3, |
| 334 | 'action' => [ 'exclude', 'source', RecentChange::SRC_NEW ], |
| 335 | 'highlight' => [ 'require', 'source', RecentChange::SRC_NEW ], |
| 336 | 'cssClassSuffix' => 'src-mw-new', |
| 337 | ], |
| 338 | [ |
| 339 | 'name' => 'hidecategorization', |
| 340 | 'label' => 'rcfilters-filter-categorization-label', |
| 341 | 'description' => 'rcfilters-filter-categorization-description', |
| 342 | // rcshowhidecategorization-show, rcshowhidecategorization-hide. |
| 343 | // wlshowhidecategorization |
| 344 | 'showHideSuffix' => 'showhidecategorization', |
| 345 | 'default' => false, |
| 346 | 'priority' => -4, |
| 347 | 'requireConfig' => [ 'RCWatchCategoryMembership' => true ], |
| 348 | 'action' => [ 'exclude', 'source', RecentChange::SRC_CATEGORIZE ], |
| 349 | 'highlight' => [ 'require', 'source', RecentChange::SRC_CATEGORIZE ], |
| 350 | 'cssClassSuffix' => 'src-mw-categorize', |
| 351 | 'conflictOptions' => [ |
| 352 | 'globalKey' => 'rcfilters-hidecategorization-conflicts-reviewstatus-global', |
| 353 | 'forwardKey' => 'rcfilters-hidecategorization-conflicts-reviewstatus', |
| 354 | 'backwardKey' => 'rcfilters-reviewstatus-conflicts-reviewstatus', |
| 355 | ], |
| 356 | 'conflictsWith' => [ |
| 357 | 'reviewStatus' => [ |
| 358 | 'unpatrolled' => [], |
| 359 | 'manual' => [], |
| 360 | ], |
| 361 | ], |
| 362 | ], |
| 363 | [ |
| 364 | 'name' => 'hidelog', |
| 365 | 'label' => 'rcfilters-filter-logactions-label', |
| 366 | 'description' => 'rcfilters-filter-logactions-description', |
| 367 | 'default' => false, |
| 368 | 'priority' => -5, |
| 369 | 'action' => [ 'exclude', 'source', RecentChange::SRC_LOG ], |
| 370 | 'highlight' => [ 'require', 'source', RecentChange::SRC_LOG ], |
| 371 | 'cssClassSuffix' => 'src-mw-log', |
| 372 | ], |
| 373 | [ |
| 374 | 'name' => 'hidenewuserlog', |
| 375 | 'label' => 'rcfilters-filter-accountcreations-label', |
| 376 | 'description' => 'rcfilters-filter-accountcreations-description', |
| 377 | 'default' => false, |
| 378 | 'priority' => -6, |
| 379 | 'action' => [ 'exclude', 'logType', 'newusers' ], |
| 380 | 'highlight' => [ 'require', 'logType', 'newusers' ], |
| 381 | 'cssClassSuffix' => 'src-mw-newuserlog', |
| 382 | ], |
| 383 | ], |
| 384 | ], |
| 385 | |
| 386 | [ |
| 387 | 'name' => 'legacyReviewStatus', |
| 388 | 'title' => 'rcfilters-filtergroup-reviewstatus', |
| 389 | 'class' => ChangesListBooleanFilterGroup::class, |
| 390 | 'requireConfig' => [ 'useRCPatrol' => true ], |
| 391 | 'filters' => [ |
| 392 | [ |
| 393 | 'name' => 'hidepatrolled', |
| 394 | // rcshowhidepatr-show, rcshowhidepatr-hide |
| 395 | // wlshowhidepatr |
| 396 | 'showHideSuffix' => 'showhidepatr', |
| 397 | 'default' => false, |
| 398 | 'action' => [ 'require', 'patrolled', RecentChange::PRC_UNPATROLLED ], |
| 399 | 'isReplacedInStructuredUi' => true, |
| 400 | ], |
| 401 | [ |
| 402 | 'name' => 'hideunpatrolled', |
| 403 | 'default' => false, |
| 404 | 'action' => [ 'exclude', 'patrolled', RecentChange::PRC_UNPATROLLED ], |
| 405 | 'isReplacedInStructuredUi' => true, |
| 406 | ], |
| 407 | ], |
| 408 | ], |
| 409 | |
| 410 | [ |
| 411 | 'name' => 'reviewStatus', |
| 412 | 'title' => 'rcfilters-filtergroup-reviewstatus', |
| 413 | 'class' => ChangesListStringOptionsFilterGroup::class, |
| 414 | 'isFullCoverage' => true, |
| 415 | 'priority' => -5, |
| 416 | 'requireConfig' => [ 'useRCPatrol' => true ], |
| 417 | 'filters' => [ |
| 418 | [ |
| 419 | 'name' => 'unpatrolled', |
| 420 | 'label' => 'rcfilters-filter-reviewstatus-unpatrolled-label', |
| 421 | 'description' => 'rcfilters-filter-reviewstatus-unpatrolled-description', |
| 422 | 'cssClassSuffix' => 'reviewstatus-unpatrolled', |
| 423 | 'action' => [ 'require', 'patrolled', RecentChange::PRC_UNPATROLLED ], |
| 424 | ], |
| 425 | [ |
| 426 | 'name' => 'manual', |
| 427 | 'label' => 'rcfilters-filter-reviewstatus-manual-label', |
| 428 | 'description' => 'rcfilters-filter-reviewstatus-manual-description', |
| 429 | 'cssClassSuffix' => 'reviewstatus-manual', |
| 430 | 'action' => [ 'require', 'patrolled', RecentChange::PRC_PATROLLED ], |
| 431 | ], |
| 432 | [ |
| 433 | 'name' => 'auto', |
| 434 | 'label' => 'rcfilters-filter-reviewstatus-auto-label', |
| 435 | 'description' => 'rcfilters-filter-reviewstatus-auto-description', |
| 436 | 'cssClassSuffix' => 'reviewstatus-auto', |
| 437 | 'action' => [ 'require', 'patrolled', RecentChange::PRC_AUTOPATROLLED ], |
| 438 | ], |
| 439 | ], |
| 440 | 'default' => ChangesListStringOptionsFilterGroup::NONE, |
| 441 | ], |
| 442 | ]; |
| 443 | } |
| 444 | |
| 445 | /** |
| 446 | * This may be overridden by subclasses to add more filter groups. |
| 447 | * |
| 448 | * @see ChangesListFilterFactory::registerFiltersFromDefinitions() |
| 449 | * @return array |
| 450 | */ |
| 451 | protected function getExtraFilterGroupDefinitions(): array { |
| 452 | return []; |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * @param string|null $subpage |
| 457 | */ |
| 458 | public function execute( $subpage ) { |
| 459 | $this->rcSubpage = $subpage; |
| 460 | |
| 461 | if ( $this->considerActionsForDefaultSavedQuery( $subpage ) ) { |
| 462 | // Don't bother rendering the page if we'll be performing a redirect (T330100). |
| 463 | return; |
| 464 | } |
| 465 | |
| 466 | // Enable OOUI and module for the clock icon. |
| 467 | if ( $this->getConfig()->get( MainConfigNames::WatchlistExpiry ) && !$this->including() ) { |
| 468 | $this->getOutput()->enableOOUI(); |
| 469 | $this->getOutput()->addModules( 'mediawiki.special.changeslist.watchlistexpiry' ); |
| 470 | } |
| 471 | |
| 472 | $opts = $this->getOptions(); |
| 473 | try { |
| 474 | $result = $this->getQueryResult(); |
| 475 | $rows = $result->getResultWrapper(); |
| 476 | |
| 477 | // Used by Structured UI app to get results without MW chrome |
| 478 | if ( $this->getRequest()->getRawVal( 'action' ) === 'render' ) { |
| 479 | $this->getOutput()->setArticleBodyOnly( true ); |
| 480 | } |
| 481 | |
| 482 | // Used by "live update" and "view newest" to check |
| 483 | // if there's new changes with minimal data transfer |
| 484 | if ( $this->getRequest()->getBool( 'peek' ) ) { |
| 485 | $code = $rows->numRows() > 0 ? 200 : 204; |
| 486 | $this->getOutput()->setStatusCode( $code ); |
| 487 | |
| 488 | if ( $this->getUser()->isAnon() !== |
| 489 | $this->getRequest()->getFuzzyBool( 'isAnon' ) |
| 490 | ) { |
| 491 | $this->getOutput()->setStatusCode( 205 ); |
| 492 | } |
| 493 | |
| 494 | return; |
| 495 | } |
| 496 | |
| 497 | $services = MediaWikiServices::getInstance(); |
| 498 | $logFormatterFactory = $services->getLogFormatterFactory(); |
| 499 | $linkBatchFactory = $services->getLinkBatchFactory(); |
| 500 | $batch = $linkBatchFactory->newLinkBatch(); |
| 501 | $userNames = []; |
| 502 | foreach ( $rows as $row ) { |
| 503 | $batch->addUser( new UserIdentityValue( $row->rc_user ?? 0, $row->rc_user_text ) ); |
| 504 | $userNames[] = $row->rc_user_text; |
| 505 | $batch->add( $row->rc_namespace, $row->rc_title ); |
| 506 | if ( $row->rc_source === RecentChange::SRC_LOG ) { |
| 507 | $formatter = $logFormatterFactory->newFromRow( $row ); |
| 508 | foreach ( $formatter->getPreloadTitles() as $title ) { |
| 509 | $batch->addObj( $title ); |
| 510 | if ( $title->inNamespace( NS_USER ) || $title->inNamespace( NS_USER_TALK ) ) { |
| 511 | $userNames[] = $title->getText(); |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | $batch->execute(); |
| 517 | foreach ( UserArray::newFromNames( $userNames ) as $_ ) { |
| 518 | // Trigger UserEditTracker::setCachedUserEditCount via User::loadFromRow |
| 519 | // Preloads edit count for User::getExperienceLevel() and Linker::userToolLinks() |
| 520 | } |
| 521 | |
| 522 | $this->setHeaders(); |
| 523 | $this->outputHeader(); |
| 524 | $this->addModules(); |
| 525 | $this->webOutput( $rows, $opts ); |
| 526 | } catch ( DBQueryTimeoutError $timeoutException ) { |
| 527 | MWExceptionHandler::logException( $timeoutException ); |
| 528 | |
| 529 | $this->setHeaders(); |
| 530 | $this->outputHeader(); |
| 531 | $this->addModules(); |
| 532 | |
| 533 | $this->getOutput()->setStatusCode( 500 ); |
| 534 | $this->webOutputHeader( 0, $opts ); |
| 535 | $this->outputTimeout(); |
| 536 | } |
| 537 | |
| 538 | $this->includeRcFiltersApp(); |
| 539 | } |
| 540 | |
| 541 | /** |
| 542 | * Set the temp user config. |
| 543 | * |
| 544 | * @internal |
| 545 | * @param TempUserConfig $tempUserConfig |
| 546 | * @since 1.42 |
| 547 | */ |
| 548 | public function setTempUserConfig( TempUserConfig $tempUserConfig ) { |
| 549 | $this->tempUserConfig = $tempUserConfig; |
| 550 | $this->changesListQueryFactory->setTempUserConfig( $tempUserConfig ); |
| 551 | } |
| 552 | |
| 553 | /** |
| 554 | * Check whether or not the page should load defaults, and if so, whether |
| 555 | * a default saved query is relevant to be redirected to. If it is relevant, |
| 556 | * redirect properly with all necessary query parameters. |
| 557 | * |
| 558 | * @param string $subpage |
| 559 | * @return bool Whether a redirect will be performed. |
| 560 | */ |
| 561 | protected function considerActionsForDefaultSavedQuery( $subpage ) { |
| 562 | if ( !$this->isStructuredFilterUiEnabled() || $this->including() ) { |
| 563 | return false; |
| 564 | } |
| 565 | |
| 566 | $knownParams = $this->getRequest()->getValues( |
| 567 | ...array_keys( $this->getOptions()->getAllValues() ) |
| 568 | ); |
| 569 | |
| 570 | // HACK: Temporarily until we can properly define "sticky" filters and parameters, |
| 571 | // we need to exclude several parameters we know should not be counted towards preventing |
| 572 | // the loading of defaults. |
| 573 | $excludedParams = [ 'limit' => '', 'days' => '', 'enhanced' => '', 'from' => '' ]; |
| 574 | $knownParams = array_diff_key( $knownParams, $excludedParams ); |
| 575 | |
| 576 | if ( |
| 577 | // If there are NO known parameters in the URL request |
| 578 | // (that are not excluded) then we need to check into loading |
| 579 | // the default saved query |
| 580 | count( $knownParams ) === 0 |
| 581 | ) { |
| 582 | $prefJson = MediaWikiServices::getInstance() |
| 583 | ->getUserOptionsLookup() |
| 584 | ->getOption( $this->getUser(), $this->getSavedQueriesPreferenceName() ); |
| 585 | |
| 586 | // Get the saved queries data and parse it |
| 587 | $savedQueries = $prefJson ? FormatJson::decode( $prefJson, true ) : false; |
| 588 | |
| 589 | if ( $savedQueries && isset( $savedQueries[ 'default' ] ) ) { |
| 590 | // Only load queries that are 'version' 2, since those |
| 591 | // have parameter representation |
| 592 | if ( isset( $savedQueries[ 'version' ] ) && $savedQueries[ 'version' ] === '2' ) { |
| 593 | $savedQueryDefaultID = $savedQueries[ 'default' ]; |
| 594 | $defaultQuery = $savedQueries[ 'queries' ][ $savedQueryDefaultID ][ 'data' ]; |
| 595 | |
| 596 | // Build the entire parameter list |
| 597 | $query = array_merge( |
| 598 | $defaultQuery[ 'params' ], |
| 599 | $defaultQuery[ 'highlights' ], |
| 600 | [ |
| 601 | 'urlversion' => '2', |
| 602 | ] |
| 603 | ); |
| 604 | // Add to the query any parameters that we may have ignored before |
| 605 | // but are still valid and requested in the URL |
| 606 | $query = array_merge( $this->getRequest()->getQueryValues(), $query ); |
| 607 | unset( $query[ 'title' ] ); |
| 608 | $this->getOutput()->redirect( $this->getPageTitle( $subpage )->getCanonicalURL( $query ) ); |
| 609 | |
| 610 | // Signal that we only need to redirect to the full URL |
| 611 | // and can skip rendering the actual page (T330100). |
| 612 | return true; |
| 613 | } else { |
| 614 | // There's a default, but the version is not 2, and the server can't |
| 615 | // actually recognize the query itself. This happens if it is before |
| 616 | // the conversion, so we need to tell the UI to reload saved query as |
| 617 | // it does the conversion to version 2 |
| 618 | $this->getOutput()->addJsConfigVars( |
| 619 | 'wgStructuredChangeFiltersDefaultSavedQueryExists', |
| 620 | true |
| 621 | ); |
| 622 | |
| 623 | // Add the class that tells the frontend it is still loading |
| 624 | // another query |
| 625 | $this->getOutput()->addBodyClasses( 'mw-rcfilters-ui-loading' ); |
| 626 | } |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | return false; |
| 631 | } |
| 632 | |
| 633 | /** |
| 634 | * @see \MediaWiki\MainConfigSchema::RCLinkDays and \MediaWiki\MainConfigSchema::RCFilterByAge. |
| 635 | * @return int[] |
| 636 | */ |
| 637 | protected function getLinkDays() { |
| 638 | $linkDays = $this->getConfig()->get( MainConfigNames::RCLinkDays ); |
| 639 | $filterByAge = $this->getConfig()->get( MainConfigNames::RCFilterByAge ); |
| 640 | $maxAge = $this->getConfig()->get( MainConfigNames::RCMaxAge ); |
| 641 | if ( $filterByAge ) { |
| 642 | // Trim it to only links which are within $wgRCMaxAge. |
| 643 | // Note that we allow one link higher than the max for things like |
| 644 | // "age 56 days" being accessible through the "60 days" link. |
| 645 | sort( $linkDays ); |
| 646 | |
| 647 | $maxAgeDays = $maxAge / ( 3600 * 24 ); |
| 648 | foreach ( $linkDays as $i => $days ) { |
| 649 | if ( $days >= $maxAgeDays ) { |
| 650 | array_splice( $linkDays, $i + 1 ); |
| 651 | break; |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | return $linkDays; |
| 657 | } |
| 658 | |
| 659 | /** |
| 660 | * Include the modules and configuration for the RCFilters app. |
| 661 | * Conditional on the user having the feature enabled. |
| 662 | * |
| 663 | * If it is disabled, add a <body> class marking that |
| 664 | */ |
| 665 | protected function includeRcFiltersApp() { |
| 666 | $out = $this->getOutput(); |
| 667 | if ( $this->isStructuredFilterUiEnabled() && !$this->including() ) { |
| 668 | $jsData = $this->filterGroups->getJsData(); |
| 669 | $messages = []; |
| 670 | foreach ( $jsData['messageKeys'] as $key ) { |
| 671 | $messages[$key] = $this->msg( $key )->plain(); |
| 672 | } |
| 673 | |
| 674 | $out->addBodyClasses( 'mw-rcfilters-enabled' ); |
| 675 | $collapsed = MediaWikiServices::getInstance()->getUserOptionsLookup() |
| 676 | ->getBoolOption( $this->getUser(), $this->getCollapsedPreferenceName() ); |
| 677 | if ( $collapsed ) { |
| 678 | $out->addBodyClasses( 'mw-rcfilters-collapsed' ); |
| 679 | } |
| 680 | |
| 681 | // These config and message exports should be moved into a ResourceLoader data module (T201574) |
| 682 | $out->addJsConfigVars( 'wgStructuredChangeFilters', $jsData['groups'] ); |
| 683 | $out->addJsConfigVars( 'wgStructuredChangeFiltersMessages', $messages ); |
| 684 | $out->addJsConfigVars( 'wgStructuredChangeFiltersCollapsedState', $collapsed ); |
| 685 | $restrictedTags = $this->getViewableRestrictedChangeTags(); |
| 686 | if ( $restrictedTags ) { |
| 687 | $out->addJsConfigVars( 'wgStructuredChangeFiltersRestrictedTags', $restrictedTags ); |
| 688 | } |
| 689 | |
| 690 | $out->addJsConfigVars( |
| 691 | 'StructuredChangeFiltersDisplayConfig', |
| 692 | [ |
| 693 | 'maxDays' => // Translate to days |
| 694 | (int)$this->getConfig()->get( MainConfigNames::RCMaxAge ) / ( 24 * 3600 ), |
| 695 | 'limitArray' => $this->getConfig()->get( MainConfigNames::RCLinkLimits ), |
| 696 | 'limitDefault' => $this->getDefaultLimit(), |
| 697 | 'daysArray' => $this->getLinkDays(), |
| 698 | 'daysDefault' => $this->getDefaultDays(), |
| 699 | ] |
| 700 | ); |
| 701 | |
| 702 | $out->addJsConfigVars( |
| 703 | 'wgStructuredChangeFiltersSavedQueriesPreferenceName', |
| 704 | $this->getSavedQueriesPreferenceName() |
| 705 | ); |
| 706 | $out->addJsConfigVars( |
| 707 | 'wgStructuredChangeFiltersLimitPreferenceName', |
| 708 | $this->getLimitPreferenceName() |
| 709 | ); |
| 710 | $out->addJsConfigVars( |
| 711 | 'wgStructuredChangeFiltersDaysPreferenceName', |
| 712 | $this->getDefaultDaysPreferenceName() |
| 713 | ); |
| 714 | $out->addJsConfigVars( |
| 715 | 'wgStructuredChangeFiltersCollapsedPreferenceName', |
| 716 | $this->getCollapsedPreferenceName() |
| 717 | ); |
| 718 | } else { |
| 719 | $out->addBodyClasses( 'mw-rcfilters-disabled' ); |
| 720 | } |
| 721 | } |
| 722 | |
| 723 | /** |
| 724 | * Returns the list of rights-restricted change tags that the user can see (restricted tags are those starting with |
| 725 | * {@link ChangeTagsStore::PRIVATE_TAG_PREFIX}). Return array can be sent as a JS configuration variable to |
| 726 | * the client for use. |
| 727 | */ |
| 728 | private function getViewableRestrictedChangeTags(): array { |
| 729 | $services = MediaWikiServices::getInstance(); |
| 730 | $changeTagsFormatter = $services->getChangeTagsFormatter(); |
| 731 | $changeTagsStore = $services->getChangeTagsStore(); |
| 732 | |
| 733 | // First check if the user can see any restricted tags using the less expensive ::getChangeTagListSummary |
| 734 | $changeTagsSummary = $changeTagsFormatter->getChangeTagListSummary( |
| 735 | $this->getContext(), |
| 736 | $this->getAuthority() |
| 737 | ); |
| 738 | $restrictedTagNames = array_fill_keys( |
| 739 | array_filter( |
| 740 | array_column( $changeTagsSummary, 'name' ), |
| 741 | static fn ( string $tagName ) => $changeTagsStore->isRestrictedTag( $tagName ) |
| 742 | ), |
| 743 | true |
| 744 | ); |
| 745 | if ( !$restrictedTagNames ) { |
| 746 | return []; |
| 747 | } |
| 748 | |
| 749 | // Now call the more expensive ::getChangeTagList to get the list for the frontend |
| 750 | return array_values( array_filter( |
| 751 | $changeTagsFormatter->getChangeTagList( $this->getContext(), $this->getAuthority() ), |
| 752 | static fn ( array $tagInfo ) => isset( $restrictedTagNames[$tagInfo['name']] ) |
| 753 | ) ); |
| 754 | } |
| 755 | |
| 756 | /** |
| 757 | * Get essential data about {@link self::getRcFiltersConfigVars()} for change detection. |
| 758 | * |
| 759 | * @internal For use by Resources.php only. |
| 760 | * @see Module::getDefinitionSummary() and Module::getVersionHash() |
| 761 | */ |
| 762 | public static function getRcFiltersConfigSummary( RL\Context $context ): array { |
| 763 | $services = MediaWikiServices::getInstance(); |
| 764 | return [ |
| 765 | // Reduce version computation by avoiding Message parsing |
| 766 | 'RCFiltersChangeTags' => $services->getChangeTagsFormatter()->getChangeTagListSummary( |
| 767 | $context, |
| 768 | self::getAuthorityForPublicChangeTags() |
| 769 | ), |
| 770 | 'StructuredChangeFiltersEditWatchlistUrl' => |
| 771 | SpecialPage::getTitleFor( 'EditWatchlist' )->getLocalURL() |
| 772 | ]; |
| 773 | } |
| 774 | |
| 775 | /** |
| 776 | * Get config vars to export with the mediawiki.rcfilters.filters.ui module. |
| 777 | * |
| 778 | * Includes the public list of change tag filters (private tags are sent via JS config variables). |
| 779 | * |
| 780 | * @internal For use by Resources.php only. |
| 781 | */ |
| 782 | public static function getRcFiltersConfigVars( RL\Context $context ): array { |
| 783 | $services = MediaWikiServices::getInstance(); |
| 784 | return [ |
| 785 | 'RCFiltersChangeTags' => $services->getChangeTagsFormatter()->getChangeTagList( |
| 786 | $context, |
| 787 | self::getAuthorityForPublicChangeTags() |
| 788 | ), |
| 789 | 'StructuredChangeFiltersEditWatchlistUrl' => |
| 790 | SpecialPage::getTitleFor( 'EditWatchlist' )->getLocalURL() |
| 791 | ]; |
| 792 | } |
| 793 | |
| 794 | /** |
| 795 | * Gets an {@link Authority} that has no rights for use in generating the list of public |
| 796 | * change tags. |
| 797 | */ |
| 798 | private static function getAuthorityForPublicChangeTags(): Authority { |
| 799 | return new SimpleAuthority( UserIdentityValue::newAnonymous( '127.0.0.1' ), [] ); |
| 800 | } |
| 801 | |
| 802 | /** |
| 803 | * Add the "no results" message to the output |
| 804 | */ |
| 805 | protected function outputNoResults() { |
| 806 | $this->getOutput()->addHTML( |
| 807 | Html::rawElement( |
| 808 | 'div', |
| 809 | [ 'class' => 'mw-changeslist-empty' ], |
| 810 | $this->msg( 'recentchanges-noresult' )->parse() |
| 811 | ) |
| 812 | ); |
| 813 | } |
| 814 | |
| 815 | /** |
| 816 | * Add the "timeout" message to the output |
| 817 | */ |
| 818 | protected function outputTimeout() { |
| 819 | $this->getOutput()->addHTML( |
| 820 | '<div class="mw-changeslist-empty mw-changeslist-timeout">' . |
| 821 | $this->msg( 'recentchanges-timeout' )->parse() . |
| 822 | '</div>' |
| 823 | ); |
| 824 | } |
| 825 | |
| 826 | /** |
| 827 | * Get the database result for this special page instance. Used by ApiFeedRecentChanges. |
| 828 | * |
| 829 | * @return IResultWrapper |
| 830 | */ |
| 831 | public function getRows() { |
| 832 | return $this->getQueryResult()->getResultWrapper(); |
| 833 | } |
| 834 | |
| 835 | /** |
| 836 | * Perform and cache the main query. |
| 837 | * |
| 838 | * @return ChangesListResult |
| 839 | */ |
| 840 | protected function getQueryResult(): ChangesListResult { |
| 841 | if ( !$this->queryResult ) { |