From 596b83a7122a5edea5776b56b956ca999cb75497 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 30 Jun 2017 06:24:53 -0700 Subject: [PATCH] Move misplaced validation for ambiguous fields in "Test Plan" to the right place Summary: When users use the web UI to enter text like "Reviewers: x" into the "Summary" or "Test Plan", we can end up with an ambiguous commit message. Some time ago we added a warning about this to the "Summary" field, and //attempted// to add it to the "Test Plan" field, but it actually gets called from the wrong place. Remove the code from the wrong place (no callers, not reachable) and put it in the right place. This fixes an issue where users could edit a test plan from the web UI to add the text "Tests: ..." and cause ambiguities on a later "arc diff --edit". Test Plan: {F5026603} Reviewers: chad, amckinley Reviewed By: chad Differential Revision: https://secure.phabricator.com/D18175 --- .../field/DifferentialTestPlanCommitMessageField.php | 7 ------- .../xaction/DifferentialRevisionTestPlanTransaction.php | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/applications/differential/field/DifferentialTestPlanCommitMessageField.php b/src/applications/differential/field/DifferentialTestPlanCommitMessageField.php index 178e51d985..a477a9036e 100644 --- a/src/applications/differential/field/DifferentialTestPlanCommitMessageField.php +++ b/src/applications/differential/field/DifferentialTestPlanCommitMessageField.php @@ -50,11 +50,4 @@ final class DifferentialTestPlanCommitMessageField ); } - public function validateTransactions($object, array $xactions) { - return $this->validateCommitMessageCorpusTransactions( - $object, - $xactions, - pht('Test Plan')); - } - } diff --git a/src/applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php b/src/applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php index bf2beab3d8..c7c77fbcff 100644 --- a/src/applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionTestPlanTransaction.php @@ -55,7 +55,10 @@ final class DifferentialRevisionTestPlanTransaction } public function validateTransactions($object, array $xactions) { - $errors = array(); + $errors = $this->validateCommitMessageCorpusTransactions( + $object, + $xactions, + pht('Test Plan')); $is_required = PhabricatorEnv::getEnvConfig( 'differential.require-test-plan-field');