Skip to content

Commit a83cb99

Browse files
author
epriestley
committedFeb 17, 2023
Fix file PHID extraction in Pholio
Summary: Ref T13682. After some change prior change likely connected to T13682, file PHIDs fail to extract properly in Pholio. Test Plan: - Created a new Pholio mock with at least one image. - Before: fatal when extracting data from this datastructure. - After: clean mock creation. Maniphest Tasks: T13682 Differential Revision: https://secure.phabricator.com/D21858
1 parent 9426765 commit a83cb99

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎src/applications/pholio/xaction/PholioImageFileTransaction.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,18 @@ public function extractFilePHIDs($object, $value) {
107107
// including old file PHIDs) because we currently don't have a storage
108108
// object when called. This might change at some point.
109109

110-
$new_phids = $value;
110+
$image_changes = $value;
111+
112+
$image_phids = array();
113+
foreach ($image_changes as $change_type => $phids) {
114+
foreach ($phids as $phid) {
115+
$image_phids[$phid] = $phid;
116+
}
117+
}
111118

112119
$file_phids = array();
113-
foreach ($new_phids as $phid) {
114-
$file_phids[] = $editor->loadPholioImage($object, $phid)
120+
foreach ($image_phids as $image_phid) {
121+
$file_phids[] = $editor->loadPholioImage($object, $image_phid)
115122
->getFilePHID();
116123
}
117124

0 commit comments

Comments
 (0)
Failed to load comments.