The transaction types TYPE_TITLE and TYPE_CONTENT were removed from PonderQuestionTransaction in rPdff028c4907dd1959859733ea0d947f244559e7f.
Thus update PonderQuestionCreateMailReceiver to use the corresponding modular transactions PonderQuestionTitleTransaction and PonderQuestionContentTransaction instead.
Details
Details
- Reviewers
valerio.bozzolan - Group Reviewers
O1: Blessed Committers - Commits
- rP8c8211787894: Fix PonderQuestionCreateMailReceiver accessing non-existing…
Carefully read the code, grep the code base, use the test case in D25656#18162.
Diff Detail
Diff Detail
- Repository
- rP Phorge
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Thanks :)
I tested this with the following snippet:
<?php require_once dirname(__FILE__).'/scripts/init/init-script.php'; $viewer = PhabricatorUser::getOmnipotentUser(); $author = id(new PhabricatorPeopleQuery()) ->setViewer($viewer) ->setLimit(1) ->executeOne(); $content_source = PhabricatorContentSource::newForSource( PhabricatorOldWorldContentSource::SOURCECONST); $title = "ASD"; $content = "LOL"; $xactions = array(); $xactions[] = id(new PonderQuestionTransaction()) ->setTransactionType(PonderQuestionTitleTransaction::TRANSACTIONTYPE) ->setNewValue($title); $xactions[] = id(new PonderQuestionTransaction()) ->setTransactionType(PonderQuestionContentTransaction::TRANSACTIONTYPE) ->setNewValue($content); $question = PonderQuestion::initializeNewQuestion($author); $editor = id(new PonderQuestionEditor()) ->setActor($author) ->setContentSource($content_source) ->setContinueOnNoEffect(true); $xactions = $editor->applyTransactions($question, $xactions);
And it correctly created a Ponder question with "ASD" as title and "LOL" as content.