diff --git a/src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php b/src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php index cba392bbb8..02f5ca5f12 100644 --- a/src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php +++ b/src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php @@ -1,7 +1,7 @@ shouldAppearOnCommitMessage()) { unset($aux_fields[$key]); } + $aux_field->setUser($request->getUser()); } $aux_fields = mpull($aux_fields, null, 'getCommitMessageKey'); @@ -66,12 +67,24 @@ class ConduitAPI_differential_parsecommitmessage_Method $field = $aux_fields[$field_key]; try { $fields[$field_key] = $field->parseValueFromCommitMessage($field_value); + $field->setValueFromParsedCommitMessage($fields[$field_key]); } catch (DifferentialFieldParseException $ex) { $field_label = $field->renderLabelForCommitMessage(); $errors[] = "Error parsing field '{$field_label}': ".$ex->getMessage(); } } + foreach ($aux_fields as $field_key => $aux_field) { + try { + $aux_field->validateField(); + } catch (DifferentialFieldValidationException $ex) { + $field_label = $aux_field->renderLabelForCommitMessage(); + $errors[] = + "Invalid or missing field '{$field_label}': ". + $ex->getMessage(); + } + } + return array( 'errors' => $errors, 'fields' => $fields, diff --git a/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php b/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php index 57d55e11e6..2821ede35b 100644 --- a/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php +++ b/src/applications/differential/field/specification/blamerev/DifferentialBlameRevisionFieldSpecification.php @@ -1,7 +1,7 @@ setValue($this->value); } - public function validateField() { - return; - } - public function shouldAppearOnRevisionView() { return true; } diff --git a/src/applications/differential/field/specification/revertplan/DifferentialRevertPlanFieldSpecification.php b/src/applications/differential/field/specification/revertplan/DifferentialRevertPlanFieldSpecification.php index 3f9cda19ac..9a7cacaf76 100644 --- a/src/applications/differential/field/specification/revertplan/DifferentialRevertPlanFieldSpecification.php +++ b/src/applications/differential/field/specification/revertplan/DifferentialRevertPlanFieldSpecification.php @@ -1,7 +1,7 @@ setValue($this->value); } - public function validateField() { - return; - } - public function shouldAppearOnRevisionView() { return true; }