From 2b41ed01c69221c99214a5c003685635dadc166d Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 8 Nov 2015 05:21:54 -0800 Subject: [PATCH] Fix no-op transaction error on `paste.create` Conduit API method Summary: Fixes T9735. I changed how the TYPE_LANGUAGE transction works a little but that accidentally tripped an error condition in `paste.create`. - Don't bail on no-effect transactions to `paste.create` (like not setting a language). - When a transaction type has no tailored UI message, make it easier to figure out which transaction is problematic. Test Plan: Ran `arc paste ...` locally. Got an error before the patch, clean paste creation afterward. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9735 Differential Revision: https://secure.phabricator.com/D14440 --- .../paste/conduit/PasteCreateConduitAPIMethod.php | 1 + .../storage/PhabricatorApplicationTransaction.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/paste/conduit/PasteCreateConduitAPIMethod.php b/src/applications/paste/conduit/PasteCreateConduitAPIMethod.php index d5ce021f13..2dae0132d4 100644 --- a/src/applications/paste/conduit/PasteCreateConduitAPIMethod.php +++ b/src/applications/paste/conduit/PasteCreateConduitAPIMethod.php @@ -60,6 +60,7 @@ final class PasteCreateConduitAPIMethod extends PasteConduitAPIMethod { $editor = id(new PhabricatorPasteEditor()) ->setActor($viewer) + ->setContinueOnNoEffect(true) ->setContentSourceFromConduitRequest($request); $xactions = $editor->applyTransactions($paste, $xactions); diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index a61de01978..9eb1609931 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -626,7 +626,9 @@ abstract class PhabricatorApplicationTransaction return pht('Edges already exist; transaction has no effect.'); } - return pht('Transaction has no effect.'); + return pht( + 'Transaction (of type "%s") has no effect.', + $this->getTransactionType()); } public function getTitle() {