1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +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:
epriestley 2017-05-30 11:49:51 -07:00
parent c4e45c6c8c
commit 7b290b94a7

View file

@ -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;
}
}