mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
Correct file PHID extraction on image update in Pholio
Summary: Ref T12776. This extraction of file PHIDs extracted "PholioImage" object PHIDs (`PHID-PIMG-...`), not "File" PHIDs (`PHID-FILE-...`). Instead, dig into the Pholio images and actually extract the file PHIDs. This method is now similar to the `PholioImageFileTransaction` method, which works already. Test Plan: - Create a mock. - Update one of the images. - In Files, view the "Attached" tab of the updated image. - Before patch: not attached to mock. - After patch: properly attached to mock. Reviewers: chad, amckinley Reviewed By: chad Maniphest Tasks: T12776 Differential Revision: https://secure.phabricator.com/D18042
This commit is contained in:
parent
c4e45c6c8c
commit
7b290b94a7
1 changed files with 13 additions and 1 deletions
|
@ -62,7 +62,19 @@ final class PholioImageReplaceTransaction
|
|||
}
|
||||
|
||||
public function extractFilePHIDs($object, $value) {
|
||||
return array($value);
|
||||
$file_phids = array();
|
||||
|
||||
$editor = $this->getEditor();
|
||||
$images = $editor->getNewImages();
|
||||
foreach ($images as $image) {
|
||||
if ($image->getPHID() !== $value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_phids[] = $image->getFilePHID();
|
||||
}
|
||||
|
||||
return $file_phids;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue