Page MenuHomePhabricator

D17885.diff
No OneTemporary

D17885.diff

diff --git a/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
@@ -6,16 +6,14 @@
const TRANSACTIONTYPE = 'points';
public function generateOldValue($object) {
- return $object->getPoints();
+ return $this->getValueForPoints($object->getPoints());
+ }
+
+ public function generateNewValue($object, $value) {
+ return $this->getValueForPoints($value);
}
public function applyInternalEffects($object, $value) {
- if (!strlen($value)) {
- $value = null;
- }
- if ($value !== null) {
- $value = (double)$value;
- }
$object->setPoints($value);
}
@@ -73,4 +71,14 @@
return $errors;
}
+ private function getValueForPoints($value) {
+ if (!strlen($value)) {
+ $value = null;
+ }
+ if ($value !== null) {
+ $value = (double)$value;
+ }
+ return $value;
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 11:45 PM (6 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710386
Default Alt Text
D17885.diff (1 KB)

Event Timeline