From 54ce4a719eb71d0c7c69ed1cc0cc577af78b3ff2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 12 Feb 2014 09:06:24 -0800 Subject: [PATCH] Fix issue where new transaction comments can be spread across multiple transactions Summary: Ref T2222. We need this `clone` when constructing the new multi-comments in Differential, or we get double-comments internally. This shows up as emails with double comment text. Test Plan: Sent some "Accept + comment" emails, only one comment in the body. Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T2222 Differential Revision: https://secure.phabricator.com/D8206 --- .../differential/storage/DifferentialComment.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/differential/storage/DifferentialComment.php b/src/applications/differential/storage/DifferentialComment.php index 66c22cd0fe..e5ee912957 100644 --- a/src/applications/differential/storage/DifferentialComment.php +++ b/src/applications/differential/storage/DifferentialComment.php @@ -21,6 +21,12 @@ final class DifferentialComment extends DifferentialDAO private $arbitraryDiffForFacebook; private $proxyComment; + public function __clone() { + if ($this->proxyComment) { + $this->proxyComment = clone $this->proxyComment; + } + } + public function getContent() { return $this->getProxyComment()->getContent(); }