From f605780893b3e57a04ac7c72b618b83828f6e45d Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 25 Sep 2014 13:42:46 -0700 Subject: [PATCH] Export Ponder question and answer bodies as remarkup blocks during transactions Summary: Fixes T6189. We currently don't raise these to the editor level, so files, mentions, and project stuff get ignored. Test Plan: Verified that files added to question and answer bodies end up attached to the relevant objects. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T6189 Differential Revision: https://secure.phabricator.com/D10564 --- .../ponder/storage/PonderAnswerTransaction.php | 12 ++++++++++++ .../ponder/storage/PonderQuestionTransaction.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/applications/ponder/storage/PonderAnswerTransaction.php b/src/applications/ponder/storage/PonderAnswerTransaction.php index e1a7c029a2..b9c7bf2190 100644 --- a/src/applications/ponder/storage/PonderAnswerTransaction.php +++ b/src/applications/ponder/storage/PonderAnswerTransaction.php @@ -33,6 +33,18 @@ final class PonderAnswerTransaction return $phids; } + public function getRemarkupBlocks() { + $blocks = parent::getRemarkupBlocks(); + + switch ($this->getTransactionType()) { + case self::TYPE_CONTENT: + $blocks[] = $this->getNewValue(); + break; + } + + return $blocks; + } + public function getTitle() { $author_phid = $this->getAuthorPHID(); $object_phid = $this->getObjectPHID(); diff --git a/src/applications/ponder/storage/PonderQuestionTransaction.php b/src/applications/ponder/storage/PonderQuestionTransaction.php index 9bfaf6a741..19590838c4 100644 --- a/src/applications/ponder/storage/PonderQuestionTransaction.php +++ b/src/applications/ponder/storage/PonderQuestionTransaction.php @@ -37,6 +37,18 @@ final class PonderQuestionTransaction return $phids; } + public function getRemarkupBlocks() { + $blocks = parent::getRemarkupBlocks(); + + switch ($this->getTransactionType()) { + case self::TYPE_CONTENT: + $blocks[] = $this->getNewValue(); + break; + } + + return $blocks; + } + public function getTitle() { $author_phid = $this->getAuthorPHID(); $object_phid = $this->getObjectPHID();