1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

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
This commit is contained in:
epriestley 2012-04-10 16:54:05 -07:00
parent 28dfeeb5d5
commit 2360504462

View file

@ -19,7 +19,7 @@
final class DifferentialTestPlanFieldSpecification final class DifferentialTestPlanFieldSpecification
extends DifferentialFieldSpecification { extends DifferentialFieldSpecification {
private $plan; private $plan = '';
// NOTE: This means "uninitialized". // NOTE: This means "uninitialized".
private $error = false; private $error = false;
@ -29,7 +29,7 @@ final class DifferentialTestPlanFieldSpecification
} }
protected function didSetRevision() { protected function didSetRevision() {
$this->plan = $this->getRevision()->getTestPlan(); $this->plan = (string)$this->getRevision()->getTestPlan();
} }
public function setValueFromRequest(AphrontRequest $request) { public function setValueFromRequest(AphrontRequest $request) {
@ -77,7 +77,7 @@ final class DifferentialTestPlanFieldSpecification
} }
public function setValueFromParsedCommitMessage($value) { public function setValueFromParsedCommitMessage($value) {
$this->plan = $value; $this->plan = (string)$value;
return $this; return $this;
} }