Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2683975
D25475.1734694794.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25475.1734694794.diff
View Options
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,10 +35,42 @@
$xactions = array();
+ // Set the Image Cover.
$xactions[] = id(new ManiphestTransaction())
->setTransactionType(ManiphestTaskCoverImageTransaction::TRANSACTIONTYPE)
->setNewValue($file->getPHID());
+ // Attach the Cover Image to the Task.
+ // Base case: handling a new file (supported):
+ // If you are the author of the new File, that File is probably private
+ // as default, so, you attach, to make it visible to Task participants.
+ // Future case: already-existing file (currently unsupported):
+ // If you are the author of an already-existing file, that may be
+ // already attached to this Object.
+ // This is currently not supported from the UX but may be supported
+ // later, checking for potential errors related to double-attach.
+ // Unknown future cases:
+ // A non-author may want to attach a semi-private already-existing file
+ // to make it somehow "more visible" than before without authorization
+ // from the original author.
+ // It is probably quite foolish to try to prevent this kind of things,
+ // since, if you can see something, indeed you can copy-pasta that.
+ // Anyway, since this use-case is unknown,
+ // we are a bit strict, requiring to be the author of that file,
+ // before sharing that as Task cover image.
+ // If you want to support this, and omit this check, join the Task :)
+ // https://we.phorge.it/T15163
+ if ($file->getAuthorPHID() === $viewer->getPHID()) {
+ $template = $object->getApplicationTransactionTemplate();
+ $attach_mode = PhabricatorFileAttachment::MODE_ATTACH;
+ $xactions[] = id(clone $template)
+ ->setTransactionType(PhabricatorTransactions::TYPE_FILE)
+ ->setNewValue(
+ array(
+ $file_phid => $attach_mode,
+ ));
+ }
+
$editor = id(new ManiphestTransactionEditor())
->setActor($viewer)
->setContinueOnMissingFields(true)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 11:39 (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1017450
Default Alt Text
D25475.1734694794.diff (2 KB)
Attached To
Mode
D25475: Drag & Drop Task Cover Image: also attach
Attached
Detach File
Event Timeline
Log In to Comment