From a75eea7637707e6ee7e0106d4c2ce6f784f71651 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 22 Jun 2016 13:23:11 -0700 Subject: [PATCH] Fix spurious timeline entry for badges Summary: Fixes T11164. At least, this fixes it locally for me. I don't know how to code. Copy Pasta! Test Plan: Change name, don't see extra timeline entry on quality set anymore. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11164 Differential Revision: https://secure.phabricator.com/D16169 --- src/applications/badges/editor/PhabricatorBadgesEditor.php | 2 +- .../badges/storage/PhabricatorBadgesTransaction.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/applications/badges/editor/PhabricatorBadgesEditor.php b/src/applications/badges/editor/PhabricatorBadgesEditor.php index e71dd622c8..45a42a3362 100644 --- a/src/applications/badges/editor/PhabricatorBadgesEditor.php +++ b/src/applications/badges/editor/PhabricatorBadgesEditor.php @@ -47,7 +47,7 @@ final class PhabricatorBadgesEditor case PhabricatorBadgesTransaction::TYPE_ICON: return $object->getIcon(); case PhabricatorBadgesTransaction::TYPE_QUALITY: - return $object->getQuality(); + return (int)$object->getQuality(); case PhabricatorBadgesTransaction::TYPE_STATUS: return $object->getStatus(); case PhabricatorBadgesTransaction::TYPE_AWARD: diff --git a/src/applications/badges/storage/PhabricatorBadgesTransaction.php b/src/applications/badges/storage/PhabricatorBadgesTransaction.php index f088c2d973..22505b247e 100644 --- a/src/applications/badges/storage/PhabricatorBadgesTransaction.php +++ b/src/applications/badges/storage/PhabricatorBadgesTransaction.php @@ -105,14 +105,14 @@ final class PhabricatorBadgesTransaction } break; case self::TYPE_QUALITY: + $qual_new = PhabricatorBadgesQuality::getQualityName($new); + $qual_old = PhabricatorBadgesQuality::getQualityName($old); if ($old === null) { return pht( '%s set the quality for this badge as "%s".', $this->renderHandleLink($author_phid), - $new); + $qual_new); } else { - $qual_new = PhabricatorBadgesQuality::getQualityName($new); - $qual_old = PhabricatorBadgesQuality::getQualityName($old); return pht( '%s updated the quality for this badge from "%s" to "%s".', $this->renderHandleLink($author_phid),