From: Umherirrender Date: Mon, 19 Aug 2019 19:57:32 +0000 (+0200) Subject: Simplify NewFilesPager::getQueryInfo X-Git-Tag: 1.34.0-rc.0~108^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=b7e741b709ea1a840cba6d4b2bcafa8c4315790f;p=lhc%2Fweb%2Fwiklou.git Simplify NewFilesPager::getQueryInfo The query here is not used for the images to display, so the query must not include all columns from the images table, because that is not used The gallery itself will load the necessary information for the display in separate queries Bug: T227608 Change-Id: I70b0d1bcdc155c38d69b5dd52bf4e3898920ab76 --- diff --git a/includes/specials/pagers/NewFilesPager.php b/includes/specials/pagers/NewFilesPager.php index be4a1bdf1e..9a78c5dda7 100644 --- a/includes/specials/pagers/NewFilesPager.php +++ b/includes/specials/pagers/NewFilesPager.php @@ -64,11 +64,11 @@ class NewFilesPager extends RangeChronologicalPager { function getQueryInfo() { $opts = $this->opts; $conds = []; - $imgQuery = LocalFile::getQueryInfo(); - $tables = $imgQuery['tables']; - $fields = [ 'img_name', 'img_timestamp' ] + $imgQuery['fields']; + $actorQuery = ActorMigration::newMigration()->getJoin( 'img_user' ); + $tables = [ 'image' ] + $actorQuery['tables']; + $fields = [ 'img_name', 'img_timestamp' ] + $actorQuery['fields']; $options = []; - $jconds = $imgQuery['joins']; + $jconds = $actorQuery['joins']; $user = $opts->getValue( 'user' ); if ( $user !== '' ) { @@ -89,7 +89,7 @@ class NewFilesPager extends RangeChronologicalPager { 'LEFT JOIN', [ 'ug_group' => $groupsWithBotPermission, - 'ug_user = ' . $imgQuery['fields']['img_user'], + 'ug_user = ' . $actorQuery['fields']['img_user'], 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) ] ]; @@ -107,7 +107,7 @@ class NewFilesPager extends RangeChronologicalPager { 'JOIN', [ 'rc_title = img_name', - 'rc_actor = ' . $imgQuery['fields']['img_actor'], + 'rc_actor = ' . $actorQuery['fields']['img_actor'], 'rc_timestamp = img_timestamp' ] ];