From 2360504462db97cb30346798d0d6d3b0990a9c06 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 10 Apr 2012 16:54:05 -0700 Subject: [PATCH] Fix null test plan database error Summary: Some Differential fields are not nullable; when Test Plan is switched to non-required mode we can end up trying to save a null value to a non-nullable column (see D2193). (I should probably just alter the schema to make these fields nullable, but that might have farther-reaching effects.) Test Plan: Reproduced error, applied patch, no more error. Reviewers: btrahan, vrana, jungejason Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D2200 --- .../testplan/DifferentialTestPlanFieldSpecification.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/field/specification/testplan/DifferentialTestPlanFieldSpecification.php b/src/applications/differential/field/specification/testplan/DifferentialTestPlanFieldSpecification.php index f03df532b8..ebd5369d41 100644 --- a/src/applications/differential/field/specification/testplan/DifferentialTestPlanFieldSpecification.php +++ b/src/applications/differential/field/specification/testplan/DifferentialTestPlanFieldSpecification.php @@ -19,7 +19,7 @@ final class DifferentialTestPlanFieldSpecification extends DifferentialFieldSpecification { - private $plan; + private $plan = ''; // NOTE: This means "uninitialized". private $error = false; @@ -29,7 +29,7 @@ final class DifferentialTestPlanFieldSpecification } protected function didSetRevision() { - $this->plan = $this->getRevision()->getTestPlan(); + $this->plan = (string)$this->getRevision()->getTestPlan(); } public function setValueFromRequest(AphrontRequest $request) { @@ -77,7 +77,7 @@ final class DifferentialTestPlanFieldSpecification } public function setValueFromParsedCommitMessage($value) { - $this->plan = $value; + $this->plan = (string)$value; return $this; }