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());