From d0de4dab24167ae85f1ca3276eb6387668c5c074 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Fri, 8 Nov 2013 17:13:36 -0800 Subject: [PATCH] Pholio - fix a bug replacing multiple images Summary: these transactions should //never// merge since they are always created for a 1:1 replacement. (ie any merging would be implicitly erroneous). Fixes T4081 Test Plan: made a mock with three images and replaced all three successfully. replaced image A with image B, did not save, replaced image B with image C, then saved and verified transaction correctly showed image A replaced with image C. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4081 Differential Revision: https://secure.phabricator.com/D7536 --- src/applications/pholio/editor/PholioMockEditor.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/pholio/editor/PholioMockEditor.php b/src/applications/pholio/editor/PholioMockEditor.php index 8cf5784cc4..a55cd62595 100644 --- a/src/applications/pholio/editor/PholioMockEditor.php +++ b/src/applications/pholio/editor/PholioMockEditor.php @@ -287,9 +287,12 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor { case PholioTransactionType::TYPE_DESCRIPTION: return $v; case PholioTransactionType::TYPE_IMAGE_REPLACE: - if ($u->getNewValue() == $v->getOldValue()) { + $u_img = $u->getNewValue(); + $v_img = $v->getNewValue(); + if ($u_img->getReplacesImagePHID() == $v_img->getReplacesImagePHID()) { return $v; } + break; case PholioTransactionType::TYPE_IMAGE_FILE: return $this->mergePHIDOrEdgeTransactions($u, $v); case PholioTransactionType::TYPE_IMAGE_NAME: