diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php index 4d0f96bde5..772be350a9 100644 --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -872,6 +872,15 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery * @task order */ public function getOrderableColumns() { + $cache = PhabricatorCaches::getRequestCache(); + $class = get_class($this); + $cache_key = 'query.orderablecolumns.'.$class; + + $columns = $cache->getKey($cache_key); + if ($columns !== null) { + return $columns; + } + $columns = array( 'id' => array( 'table' => $this->getPrimaryTableAlias(), @@ -909,6 +918,8 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery } } + $cache->setKey($cache_key, $columns); + return $columns; }