From 82f47f968989aa32a4cba57c3a33b506b7fbf9da Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 17 Feb 2015 11:07:14 -0800 Subject: [PATCH] Legalpad - fix requires signature transaction from always being saved Summary: Fixes T7295. Humbling debugging experience but I got it. Test Plan: saved a legalpad doc without edits over and over and saw no "requires signature" transaction. toggled "requires signature", saved, and saw the transaction. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7295 Differential Revision: https://secure.phabricator.com/D11785 --- .../legalpad/editor/LegalpadDocumentEditor.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applications/legalpad/editor/LegalpadDocumentEditor.php b/src/applications/legalpad/editor/LegalpadDocumentEditor.php index 32c8c690ec..7b0f50b462 100644 --- a/src/applications/legalpad/editor/LegalpadDocumentEditor.php +++ b/src/applications/legalpad/editor/LegalpadDocumentEditor.php @@ -51,7 +51,7 @@ final class LegalpadDocumentEditor case LegalpadTransactionType::TYPE_PREAMBLE: return $object->getPreamble(); case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE: - return $object->getRequireSignature(); + return (bool)$object->getRequireSignature(); } } @@ -64,8 +64,9 @@ final class LegalpadDocumentEditor case LegalpadTransactionType::TYPE_TEXT: case LegalpadTransactionType::TYPE_SIGNATURE_TYPE: case LegalpadTransactionType::TYPE_PREAMBLE: - case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE: return $xaction->getNewValue(); + case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE: + return (bool)$xaction->getNewValue(); } } @@ -92,7 +93,7 @@ final class LegalpadDocumentEditor $object->setPreamble($xaction->getNewValue()); break; case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE: - $object->setRequireSignature($xaction->getNewValue()); + $object->setRequireSignature((int)$xaction->getNewValue()); break; } }