Page MenuHomePhabricator

D14494.id.diff
No OneTemporary

D14494.id.diff

diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -623,9 +623,8 @@
switch ($xaction->getTransactionType()) {
case ConpherenceTransaction::TYPE_PICTURE:
- return array($xaction->getNewValue()->getPHID());
case ConpherenceTransaction::TYPE_PICTURE_CROP:
- return array($xaction->getNewValue());
+ return array($xaction->getNewValue());
}
return parent::extractFilePHIDsFromCustomTransaction($object, $xaction);
diff --git a/src/applications/pholio/editor/PholioMockEditor.php b/src/applications/pholio/editor/PholioMockEditor.php
--- a/src/applications/pholio/editor/PholioMockEditor.php
+++ b/src/applications/pholio/editor/PholioMockEditor.php
@@ -120,19 +120,31 @@
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
+ $images = $this->getNewImages();
+ $images = mpull($images, null, 'getPHID');
+
switch ($xaction->getTransactionType()) {
case PholioTransaction::TYPE_IMAGE_FILE:
- $new = $xaction->getNewValue();
- $phids = array();
- foreach ($new as $key => $images) {
- $phids[] = mpull($images, 'getFilePHID');
+ $file_phids = array();
+ foreach ($xaction->getNewValue() as $image_phid) {
+ $image = idx($images, $image_phid);
+ if (!$image) {
+ continue;
+ }
+ $file_phids[] = $image->getFilePHID();
}
- return array_mergev($phids);
+ return $file_phids;
case PholioTransaction::TYPE_IMAGE_REPLACE:
- return array($xaction->getNewValue()->getFilePHID());
+ $image_phid = $xaction->getNewValue();
+ $image = idx($images, $image_phid);
+
+ if ($image) {
+ return array($image->getFilePHID());
+ }
+ break;
}
- return array();
+ return parent::extractFilePHIDsFromCustomTransaction($object, $xaction);
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -775,8 +775,6 @@
throw new PhabricatorApplicationTransactionValidationException($errors);
}
- $file_phids = $this->extractFilePHIDs($object, $xactions);
-
if ($object->getID()) {
foreach ($xactions as $xaction) {
@@ -822,6 +820,7 @@
}
$xactions = $this->sortTransactions($xactions);
+ $file_phids = $this->extractFilePHIDs($object, $xactions);
if ($is_preview) {
$this->loadHandles($xactions);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 6:14 AM (1 w, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6729601
Default Alt Text
D14494.id.diff (2 KB)

Event Timeline