Skip to content

Commit 2360504

Browse files
author
epriestley
committedApr 10, 2012
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
1 parent 28dfeeb commit 2360504

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/applications/differential/field/specification/testplan/DifferentialTestPlanFieldSpecification.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
final class DifferentialTestPlanFieldSpecification
2020
extends DifferentialFieldSpecification {
2121

22-
private $plan;
22+
private $plan = '';
2323

2424
// NOTE: This means "uninitialized".
2525
private $error = false;
@@ -29,7 +29,7 @@ public function shouldAppearOnEdit() {
2929
}
3030

3131
protected function didSetRevision() {
32-
$this->plan = $this->getRevision()->getTestPlan();
32+
$this->plan = (string)$this->getRevision()->getTestPlan();
3333
}
3434

3535
public function setValueFromRequest(AphrontRequest $request) {
@@ -77,7 +77,7 @@ public function getCommitMessageKey() {
7777
}
7878

7979
public function setValueFromParsedCommitMessage($value) {
80-
$this->plan = $value;
80+
$this->plan = (string)$value;
8181
return $this;
8282
}
8383

0 commit comments

Comments
 (0)
Failed to load comments.