mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-06 11:58:30 +01:00
Summary: Fixes T12197. I //think// this field was never recognized by Differential (it doesn't appear in D17070, but maybe that isn't the right change). It was recognized by the ad-hoc regular expression which I replaced with a formal parser in D17262. Allow the former parser to accept "Auditor" as an alias for "Auditors". Test Plan: Committed a change with `Auditor: dog`, saw the audit trigger correctly in the web UI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12197 Differential Revision: https://secure.phabricator.com/D17306
52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class DifferentialAuditorsCommitMessageField
|
|
extends DifferentialCommitMessageCustomField {
|
|
|
|
const FIELDKEY = 'phabricator:auditors';
|
|
|
|
public function getFieldName() {
|
|
return pht('Auditors');
|
|
}
|
|
|
|
public function getFieldAliases() {
|
|
return array(
|
|
'Auditor',
|
|
);
|
|
}
|
|
|
|
public function parseFieldValue($value) {
|
|
return $this->parseObjectList(
|
|
$value,
|
|
array(
|
|
PhabricatorPeopleUserPHIDType::TYPECONST,
|
|
PhabricatorProjectProjectPHIDType::TYPECONST,
|
|
PhabricatorOwnersPackagePHIDType::TYPECONST,
|
|
));
|
|
}
|
|
|
|
public function getCustomFieldKey() {
|
|
return 'phabricator:auditors';
|
|
}
|
|
|
|
public function isFieldEditable() {
|
|
return true;
|
|
}
|
|
|
|
public function isTemplateField() {
|
|
return false;
|
|
}
|
|
|
|
public function readFieldValueFromConduit($value) {
|
|
return $this->readStringListFieldValueFromConduit($value);
|
|
}
|
|
|
|
public function renderFieldValue($value) {
|
|
return $this->renderHandleList($value);
|
|
}
|
|
|
|
protected function readFieldValueFromCustomFieldStorage($value) {
|
|
return $this->readJSONFieldValueFromCustomFieldStorage($value, array());
|
|
}
|
|
|
|
}
|