Page MenuHomePhorge

D25475.1734677179.diff
No OneTemporary

D25475.1734677179.diff

diff --git a/src/applications/maniphest/xaction/ManiphestTaskCoverImageTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskCoverImageTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskCoverImageTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskCoverImageTransaction.php
@@ -33,6 +33,20 @@
$object->setProperty('cover.filePHID', $file->getPHID());
$object->setProperty('cover.thumbnailPHID', $xform->getPHID());
+
+ // Connect the Transform to the original file.
+ // In this way the user can change the permissions of the original File
+ // and this Transform automatically reflects these policies.
+ $xtransformed = id(new PhabricatorTransformedFile())
+ ->setOriginalPHID($file_phid)
+ ->setTransformedPHID($xform->getPHID())
+ ->setTransform($xform_key)
+ ->save();
+
+ // As side-effect, attach the Cover Image to the Object,
+ // otherwise it may be invisible to other participants.
+ // This is always successful.
+ $file->attachToObject($object->getPHID());
}
public function getTitle() {
diff --git a/src/applications/project/controller/PhabricatorProjectCoverController.php b/src/applications/project/controller/PhabricatorProjectCoverController.php
--- a/src/applications/project/controller/PhabricatorProjectCoverController.php
+++ b/src/applications/project/controller/PhabricatorProjectCoverController.php
@@ -35,6 +35,7 @@
$xactions = array();
+ // Set the new Cover Image.
$xactions[] = id(new ManiphestTransaction())
->setTransactionType(ManiphestTaskCoverImageTransaction::TRANSACTIONTYPE)
->setNewValue($file->getPHID());

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 06:46 (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016722
Default Alt Text
D25475.1734677179.diff (1 KB)

Event Timeline