From 826f03d928775bc0403e1130d46de93a7115afe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Fri, 9 Oct 2020 15:41:19 +0200 Subject: [PATCH] Remove sorting by user from Special:AbuseFilter/history This feature didn't work and even if we fixed it as suggested in the task, it would still be bogus. For deterministic paging, the afh_user_text field should be in an index together with another field(s). But currently it's indexed alone. By the way, the indexes on abuse_filter_history should be fixed anyway. Special:AbuseFilter/history also allows filtering by filter/user which require index on the fields. They are present but are not composite, so either the sorting is done inefficiently without an index or there is a fullscan. Also remove the getIndexField override. TablePager knows best what value can be used there, we don't really have to override it. Bug: T204210 Change-Id: I7335f82c917a1d219fd7f0999da5b62433f14bd8 --- includes/pagers/AbuseFilterHistoryPager.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/includes/pagers/AbuseFilterHistoryPager.php b/includes/pagers/AbuseFilterHistoryPager.php index 550b6faba..948f9cd7d 100644 --- a/includes/pagers/AbuseFilterHistoryPager.php +++ b/includes/pagers/AbuseFilterHistoryPager.php @@ -201,13 +201,6 @@ class AbuseFilterHistoryPager extends TablePager { return $info; } - /** - * @return string - */ - public function getIndexField() { - return 'afh_timestamp'; - } - /** * @return string */ @@ -220,8 +213,7 @@ class AbuseFilterHistoryPager extends TablePager { * @return bool */ public function isFieldSortable( $name ) { - $sortable_fields = [ 'afh_timestamp', 'afh_user_text' ]; - return in_array( $name, $sortable_fields ); + return $name === 'afh_timestamp'; } /**