Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14417418
D19224.id46029.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19224.id46029.diff
View Options
diff --git a/src/applications/files/query/PhabricatorFileQuery.php b/src/applications/files/query/PhabricatorFileQuery.php
--- a/src/applications/files/query/PhabricatorFileQuery.php
+++ b/src/applications/files/query/PhabricatorFileQuery.php
@@ -165,6 +165,7 @@
// However, in some special cases where we know files will always be
// visible, we skip this. See T8478 and T13106.
$need_objects = array();
+ $need_xforms = array();
foreach ($files as $file) {
$always_visible = false;
@@ -187,6 +188,7 @@
}
$need_objects[] = $file;
+ $need_xforms[] = $file;
}
$viewer = $this->getViewer();
@@ -226,15 +228,20 @@
// If this file is a transform of another file, load that file too. If you
// can see the original file, you can see the thumbnail.
- // TODO: It might be nice to put this directly on PhabricatorFile and remove
- // the PhabricatorTransformedFile table, which would be a little simpler.
+ // TODO: It might be nice to put this directly on PhabricatorFile and
+ // remove the PhabricatorTransformedFile table, which would be a little
+ // simpler.
- $xforms = id(new PhabricatorTransformedFile())->loadAllWhere(
- 'transformedPHID IN (%Ls)',
- mpull($files, 'getPHID'));
- $xform_phids = mpull($xforms, 'getOriginalPHID', 'getTransformedPHID');
- foreach ($xform_phids as $derived_phid => $original_phid) {
- $object_phids[$original_phid] = true;
+ if ($need_xforms) {
+ $xforms = id(new PhabricatorTransformedFile())->loadAllWhere(
+ 'transformedPHID IN (%Ls)',
+ mpull($need_xforms, 'getPHID'));
+ $xform_phids = mpull($xforms, 'getOriginalPHID', 'getTransformedPHID');
+ foreach ($xform_phids as $derived_phid => $original_phid) {
+ $object_phids[$original_phid] = true;
+ }
+ } else {
+ $xform_phids = array();
}
$object_phids = array_keys($object_phids);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 1:03 AM (11 h, 52 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926577
Default Alt Text
D19224.id46029.diff (1 KB)
Attached To
Mode
D19224: Skip loading file transform sources when we know a file is not transformed
Attached
Detach File
Event Timeline
Log In to Comment