Differential D25475 Diff 1815 src/applications/project/controller/PhabricatorProjectCoverController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectCoverController.php
Show All 29 Lines | $file = id(new PhabricatorFileQuery()) | ||||
->withPHIDs(array($file_phid)) | ->withPHIDs(array($file_phid)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$file) { | if (!$file) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$xactions = array(); | $xactions = array(); | ||||
// Set the new Cover Image. | |||||
$xactions[] = id(new ManiphestTransaction()) | $xactions[] = id(new ManiphestTransaction()) | ||||
->setTransactionType(ManiphestTaskCoverImageTransaction::TRANSACTIONTYPE) | ->setTransactionType(ManiphestTaskCoverImageTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($file->getPHID()); | ->setNewValue($file->getPHID()); | ||||
$editor = id(new ManiphestTransactionEditor()) | $editor = id(new ManiphestTransactionEditor()) | ||||
->setActor($viewer) | ->setActor($viewer) | ||||
->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
->setContentSourceFromRequest($request); | ->setContentSourceFromRequest($request); | ||||
$editor->applyTransactions($object, $xactions); | $editor->applyTransactions($object, $xactions); | ||||
return $this->newCardResponse($board_phid, $object_phid); | return $this->newCardResponse($board_phid, $object_phid); | ||||
} | } | ||||
} | } | ||||
valerio.bozzolan: Probably, this could also be done inside an `expandTransaction` method in… |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Probably, this could also be done inside an expandTransaction method in ManiphestTransactionEditor. But I'm not bold enough to generalize this. Thanks for tips.