@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Generate newValue for ManiphestTaskPointTransaction

Summary: I think this is the correct fix, sets a consistent value for transactions, old and new, for Maniphest point values.

Test Plan:
Edit title, see no point feed story, set points, see point story, set points to same value, see no story, remove points, see remove point story.

{F4958233}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17885

+15 -7
+15 -7
src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'points'; 7 7 8 8 public function generateOldValue($object) { 9 - return $object->getPoints(); 9 + return $this->getValueForPoints($object->getPoints()); 10 + } 11 + 12 + public function generateNewValue($object, $value) { 13 + return $this->getValueForPoints($value); 10 14 } 11 15 12 16 public function applyInternalEffects($object, $value) { 13 - if (!strlen($value)) { 14 - $value = null; 15 - } 16 - if ($value !== null) { 17 - $value = (double)$value; 18 - } 19 17 $object->setPoints($value); 20 18 } 21 19 ··· 71 69 } 72 70 73 71 return $errors; 72 + } 73 + 74 + private function getValueForPoints($value) { 75 + if (!strlen($value)) { 76 + $value = null; 77 + } 78 + if ($value !== null) { 79 + $value = (double)$value; 80 + } 81 + return $value; 74 82 } 75 83 76 84 }