mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10: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:
parent
e068b04b5c
commit
8a409aa40f
2 changed files with 15 additions and 1 deletions
|
@ -51,11 +51,15 @@ abstract class DifferentialCustomField
|
|||
return array();
|
||||
}
|
||||
|
||||
protected function parseObjectList($value, array $types) {
|
||||
protected function parseObjectList(
|
||||
$value,
|
||||
array $types,
|
||||
$allow_partial = false) {
|
||||
return id(new PhabricatorObjectListQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->setAllowedTypes($types)
|
||||
->setObjectList($value)
|
||||
->setAllowPartialResults($allow_partial)
|
||||
->execute();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,16 @@ final class DifferentialReviewedByField
|
|||
return true;
|
||||
}
|
||||
|
||||
public function parseValueFromCommitMessage($value) {
|
||||
return $this->parseObjectList(
|
||||
$value,
|
||||
array(
|
||||
PhabricatorPeoplePHIDTypeUser::TYPECONST,
|
||||
PhabricatorProjectPHIDTypeProject::TYPECONST,
|
||||
),
|
||||
$allow_partial = true);
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDsForCommitMessage() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue