1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Fix parsing of "Reviewed By" field

Summary: In the Message parser, we read this field and expect to get an array of PHIDs out of it. Currently, we get a string. Instead, get an array of PHIDs.

Test Plan: Wrote a message like "Fixes Tnnn" with "Reviewed by: duck", and saw no more parse error during message parsing.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Differential Revision: https://secure.phabricator.com/D8510
This commit is contained in:
epriestley 2014-03-12 18:11:09 -07:00
parent e068b04b5c
commit 8a409aa40f
2 changed files with 15 additions and 1 deletions

View file

@ -51,11 +51,15 @@ abstract class DifferentialCustomField
return array(); return array();
} }
protected function parseObjectList($value, array $types) { protected function parseObjectList(
$value,
array $types,
$allow_partial = false) {
return id(new PhabricatorObjectListQuery()) return id(new PhabricatorObjectListQuery())
->setViewer($this->getViewer()) ->setViewer($this->getViewer())
->setAllowedTypes($types) ->setAllowedTypes($types)
->setObjectList($value) ->setObjectList($value)
->setAllowPartialResults($allow_partial)
->execute(); ->execute();
} }

View file

@ -51,6 +51,16 @@ final class DifferentialReviewedByField
return true; return true;
} }
public function parseValueFromCommitMessage($value) {
return $this->parseObjectList(
$value,
array(
PhabricatorPeoplePHIDTypeUser::TYPECONST,
PhabricatorProjectPHIDTypeProject::TYPECONST,
),
$allow_partial = true);
}
public function getRequiredHandlePHIDsForCommitMessage() { public function getRequiredHandlePHIDsForCommitMessage() {
return $this->getValue(); return $this->getValue();
} }