@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.

Route attached objects through new editor

Summary: Ref T2217. Nothing too surprising here. This transaction type is weird and should be replaced with the mainstream EDGE type at some point after things clear up more.

Test Plan: Attached and detached revisions and mocks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

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

+31 -11
+9
src/applications/maniphest/editor/ManiphestTransactionEditorPro.php
··· 15 15 $types[] = ManiphestTransactionPro::TYPE_CCS; 16 16 $types[] = ManiphestTransactionPro::TYPE_PROJECTS; 17 17 $types[] = ManiphestTransactionPro::TYPE_ATTACH; 18 + $types[] = ManiphestTransactionPro::TYPE_EDGE; 18 19 19 20 return $types; 20 21 } ··· 40 41 return $object->getProjectPHIDs(); 41 42 case ManiphestTransactionPro::TYPE_ATTACH: 42 43 return $object->getAttached(); 44 + case ManiphestTransactionPro::TYPE_EDGE: 45 + // These are pre-populated. 46 + return $xaction->getOldValue(); 43 47 } 44 48 45 49 } ··· 58 62 case ManiphestTransactionPro::TYPE_CCS: 59 63 case ManiphestTransactionPro::TYPE_PROJECTS: 60 64 case ManiphestTransactionPro::TYPE_ATTACH: 65 + case ManiphestTransactionPro::TYPE_EDGE: 61 66 return $xaction->getNewValue(); 62 67 } 63 68 ··· 84 89 return $object->setProjectPHIDs($xaction->getNewValue()); 85 90 case ManiphestTransactionPro::TYPE_ATTACH: 86 91 return $object->setAttached($xaction->getNewValue()); 92 + case ManiphestTransactionPro::TYPE_EDGE: 93 + // These are a weird, funky mess and are already being applied by the 94 + // time we reach this. 95 + return; 87 96 } 88 97 89 98 }
+11 -9
src/applications/maniphest/event/ManiphestEdgeEventListener.php
··· 55 55 unset($this->edges[$id]); 56 56 unset($this->tasks[$id]); 57 57 58 + $content_source = PhabricatorContentSource::newForSource( 59 + PhabricatorContentSource::SOURCE_LEGACY, 60 + array()); 61 + 58 62 $new_edges = $this->loadAllEdges($event); 59 - $editor = new ManiphestTransactionEditor(); 60 - $editor->setActor($event->getUser()); 63 + $editor = id(new ManiphestTransactionEditorPro()) 64 + ->setActor($event->getUser()) 65 + ->setContentSource($content_source) 66 + ->setContinueOnNoEffect(true) 67 + ->setContinueOnMissingFields(true); 61 68 62 69 foreach ($tasks as $phid => $task) { 63 70 $xactions = array(); ··· 74 81 continue; 75 82 } 76 83 77 - $xactions[] = id(new ManiphestTransaction()) 84 + $xactions[] = id(new ManiphestTransactionPro()) 78 85 ->setTransactionType(ManiphestTransactionType::TYPE_EDGE) 79 86 ->setOldValue($old_type) 80 87 ->setNewValue($new_type) 81 - ->setMetadataValue('edge:type', $type) 82 - ->setContentSource( 83 - PhabricatorContentSource::newForSource( 84 - PhabricatorContentSource::SOURCE_LEGACY, 85 - array())) 86 - ->setAuthorPHID($event->getUser()->getPHID()); 88 + ->setMetadataValue('edge:type', $type); 87 89 } 88 90 89 91 if ($xactions) {
+11 -2
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 657 657 "You can not apply transactions which already have commentVersions!"); 658 658 } 659 659 660 - $custom_field_type = PhabricatorTransactions::TYPE_CUSTOMFIELD; 661 - if ($xaction->getTransactionType() != $custom_field_type) { 660 + $exempt_types = array( 661 + // CustomField logic currently prefills these before we enter the 662 + // transaction editor. 663 + PhabricatorTransactions::TYPE_CUSTOMFIELD => true, 664 + 665 + // TODO: Remove this, this edge type is encumbered with a bunch of 666 + // legacy nonsense. 667 + ManiphestTransactionPro::TYPE_EDGE => true, 668 + ); 669 + 670 + if (empty($exempt_types[$xaction->getTransactionType()])) { 662 671 if ($xaction->getOldValue() !== null) { 663 672 throw new Exception( 664 673 "You can not apply transactions which already have oldValue!");