@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Simplify UNION/ORDER query construction in DifferentialRevisionQuery

Summary: Ref T12680. Use the slightly sleeker construction from D18722 in Differential.

Test Plan: Viewed revision list, reordered by date modified.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12680

Differential Revision: https://secure.phabricator.com/D18727

+2 -14
+2 -14
src/applications/differential/query/DifferentialRevisionQuery.php
··· 38 38 private $needDrafts; 39 39 private $needFlags; 40 40 41 - private $buildingGlobalOrder; 42 - 43 41 44 42 /* -( Query Configuration )------------------------------------------------ */ 45 43 ··· 484 482 } 485 483 486 484 if (count($selects) > 1) { 487 - $this->buildingGlobalOrder = true; 488 485 $query = qsprintf( 489 486 $conn_r, 490 487 '%Q %Q %Q', 491 488 implode(' UNION DISTINCT ', $selects), 492 - $this->buildOrderClause($conn_r), 489 + $this->buildOrderClause($conn_r, true), 493 490 $this->buildLimitClause($conn_r)); 494 491 } else { 495 492 $query = head($selects); ··· 513 510 $group_by = $this->buildGroupClause($conn_r); 514 511 $having = $this->buildHavingClause($conn_r); 515 512 516 - $this->buildingGlobalOrder = false; 517 513 $order_by = $this->buildOrderClause($conn_r); 518 514 519 515 $limit = $this->buildLimitClause($conn_r); ··· 758 754 } 759 755 760 756 public function getOrderableColumns() { 761 - $primary = ($this->buildingGlobalOrder ? null : 'r'); 762 - 763 757 return array( 764 - 'id' => array( 765 - 'table' => $primary, 766 - 'column' => 'id', 767 - 'type' => 'int', 768 - 'unique' => true, 769 - ), 770 758 'updated' => array( 771 - 'table' => $primary, 759 + 'table' => $this->getPrimaryTableAlias(), 772 760 'column' => 'dateModified', 773 761 'type' => 'int', 774 762 ),