After this change, the cover image is finally always visible to others (to people who can see the Task)
instead of being visible only to yourself.
Example conversation before this change:
- Anna: (uploads a nice Cover Image on the Task, using drag & drop from the Workboard)
- Bob: Thanks! But I cannot see that image. Please change visibility.
- Anna: Ouch! How?
- Bob: I don't know. Try Files > your File > Edit > Set Visibility > Something that includes "Bob".
- Anna: Done. Do you see my image now? (Spoiler: it's a green pepper)
- Bob: Yes and no. I mean, I can see the original file, but not from the Workboard.
- Anna: Uh? Have you tried refreshing your cache?
- Bob: Yes. Still invisible from Workboard.
- Anna: Maybe you have to change Defaults Permissions of the "Files" Application, to have "All Users"
- Bob: That is a bit invasive. Let's try. I changed the Files policy globally. Try re-uploading your image again.
- Anna: Done. Do you see it now?
- Bob: Yes! I can finally see it now, also from the Workboard.
Example conversation after this change:
- Anna: (uploads a nice Cover Image on the Task, using drag & drop from the Workboard)
Done! So, after this change, everything works as expected. Every task participant can see that image,
and nobody starts a nonsense conversation, and nobody needs to do random experiments with
default application policies.
So, after this change:
- the original file is attached to the Task
- the cover image is not orphan anymore, but mentioned in the "Transforms" of the original file
- the cover image so now inherits the original file policies
So, Task participants can finally see that cover image (transform), since it comes from a file,
and that file is attached to the Task, and since they can see that Task.
For a micro-optimization, this change refactors a bit PhabricatorFile.
You can still work in object-oriented:
$file->attachToObject($task_phid);
But now you can also work directly with PHIDs, if necessary:
PhabricatorFile::attachFileToObject($file_phid, $task_phid)
This patch somehow improves T15768.