@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adjust paste content transaction to support earlier file PHID extraction

Summary: Ref T13603. New transactional file attachment extracts PHIDs earlier than the older mechanism did. Allow either pathway to save content and extract a PHID.

Test Plan:
- Created and modified a paste.
- Confirmed both pathways do old and new storage writes.

Maniphest Tasks: T13603

Differential Revision: https://secure.phabricator.com/D21817

+16 -1
+16 -1
src/applications/paste/xaction/PhabricatorPasteContentTransaction.php
··· 5 5 6 6 const TRANSACTIONTYPE = 'paste.create'; 7 7 8 + private $filePHID; 9 + 8 10 public function generateOldValue($object) { 9 11 return $object->getFilePHID(); 10 12 } ··· 14 16 } 15 17 16 18 public function extractFilePHIDs($object, $value) { 17 - return array($value); 19 + $file_phid = $this->getFilePHID($object, $value); 20 + return array($file_phid); 18 21 } 19 22 20 23 public function validateTransactions($object, array $xactions) { ··· 31 34 } 32 35 33 36 public function generateNewValue($object, $value) { 37 + return $this->getFilePHID($object, $value); 38 + } 39 + 40 + private function getFilePHID($object, $value) { 41 + if ($this->filePHID === null) { 42 + $this->filePHID = $this->newFilePHID($object, $value); 43 + } 44 + 45 + return $this->filePHID; 46 + } 47 + 48 + private function newFilePHID($object, $value) { 34 49 // If this transaction does not really change the paste content, return 35 50 // the current file PHID so this transaction no-ops. 36 51 $old_content = $object->getRawContent();