diff --git a/src/applications/maniphest/herald/ManiphestTaskPriorityHeraldAction.php b/src/applications/maniphest/herald/ManiphestTaskPriorityHeraldAction.php index 2e2db4b62d..8fe5e07122 100644 --- a/src/applications/maniphest/herald/ManiphestTaskPriorityHeraldAction.php +++ b/src/applications/maniphest/herald/ManiphestTaskPriorityHeraldAction.php @@ -1,90 +1,91 @@ getTarget()); if (!$priority) { $this->logEffect(self::DO_STANDARD_EMPTY); return; } $adapter = $this->getAdapter(); $object = $adapter->getObject(); $current = $object->getPriority(); if ($current == $priority) { $this->logEffect(self::DO_STANDARD_NO_EFFECT, $priority); return; } $keyword_map = ManiphestTaskPriority::getTaskPriorityKeywordsMap(); $keyword = head(idx($keyword_map, $priority)); $xaction = $adapter->newTransaction() ->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE) ->setNewValue($keyword); $adapter->queueTransaction($xaction); $this->logEffect(self::DO_PRIORITY, $keyword); } public function getHeraldActionStandardType() { return self::STANDARD_PHID_LIST; } public function renderActionDescription($value) { $priority = head($value); $name = ManiphestTaskPriority::getTaskPriorityName($priority); return pht('Change priority to: %s.', $name); } protected function getDatasource() { - return new ManiphestTaskPriorityDatasource(); + return id(new ManiphestTaskPriorityDatasource()) + ->setLimit(1); } protected function getDatasourceValueMap() { return ManiphestTaskPriority::getTaskPriorityMap(); } protected function getActionEffectMap() { return array( self::DO_PRIORITY => array( 'icon' => 'fa-pencil', 'color' => 'green', 'name' => pht('Changed Task Priority'), ), ); } protected function renderActionEffectDescription($type, $data) { switch ($type) { case self::DO_PRIORITY: return pht( 'Changed task priority to "%s".', ManiphestTaskPriority::getTaskPriorityName($data)); } } } diff --git a/src/applications/maniphest/herald/ManiphestTaskStatusHeraldAction.php b/src/applications/maniphest/herald/ManiphestTaskStatusHeraldAction.php index c1ff3bcdc7..de84b3c245 100644 --- a/src/applications/maniphest/herald/ManiphestTaskStatusHeraldAction.php +++ b/src/applications/maniphest/herald/ManiphestTaskStatusHeraldAction.php @@ -1,87 +1,88 @@ getTarget()); if (!$status) { $this->logEffect(self::DO_STANDARD_EMPTY); return; } $adapter = $this->getAdapter(); $object = $adapter->getObject(); $current = $object->getStatus(); if ($current == $status) { $this->logEffect(self::DO_STANDARD_NO_EFFECT, $status); return; } $xaction = $adapter->newTransaction() ->setTransactionType(ManiphestTaskStatusTransaction::TRANSACTIONTYPE) ->setNewValue($status); $adapter->queueTransaction($xaction); $this->logEffect(self::DO_STATUS, $status); } public function getHeraldActionStandardType() { return self::STANDARD_PHID_LIST; } public function renderActionDescription($value) { $status = head($value); $name = ManiphestTaskStatus::getTaskStatusName($status); return pht('Change status to: %s.', $name); } protected function getDatasource() { - return new ManiphestTaskStatusDatasource(); + return id(new ManiphestTaskStatusDatasource()) + ->setLimit(1); } protected function getDatasourceValueMap() { return ManiphestTaskStatus::getTaskStatusMap(); } protected function getActionEffectMap() { return array( self::DO_STATUS => array( 'icon' => 'fa-pencil', 'color' => 'green', 'name' => pht('Changed Task Status'), ), ); } protected function renderActionEffectDescription($type, $data) { switch ($type) { case self::DO_STATUS: return pht( 'Changed task status to "%s".', ManiphestTaskStatus::getTaskStatusName($data)); } } }