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

Implement DestructibleInterface for dashboards and panels

Summary: Fixes T5471.

Test Plan: Used `bin/remove destroy` to destroy a dashboard and a panel.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5471

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

+39 -2
+2
src/__phutil_library_map__.php
··· 4231 4231 'PhabricatorDashboard' => array( 4232 4232 'PhabricatorDashboardDAO', 4233 4233 'PhabricatorPolicyInterface', 4234 + 'PhabricatorDestructibleInterface', 4234 4235 ), 4235 4236 'PhabricatorDashboardAddPanelController' => 'PhabricatorDashboardController', 4236 4237 'PhabricatorDashboardApplication' => 'PhabricatorApplication', ··· 4249 4250 'PhabricatorDashboardDAO', 4250 4251 'PhabricatorPolicyInterface', 4251 4252 'PhabricatorCustomFieldInterface', 4253 + 'PhabricatorDestructibleInterface', 4252 4254 ), 4253 4255 'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController', 4254 4256 'PhabricatorDashboardPanelCoreCustomField' => array(
+23 -1
src/applications/dashboard/storage/PhabricatorDashboard.php
··· 4 4 * A collection of dashboard panels with a specific layout. 5 5 */ 6 6 final class PhabricatorDashboard extends PhabricatorDashboardDAO 7 - implements PhabricatorPolicyInterface { 7 + implements 8 + PhabricatorPolicyInterface, 9 + PhabricatorDestructibleInterface { 8 10 9 11 protected $name; 10 12 protected $viewPolicy; ··· 103 105 public function describeAutomaticCapability($capability) { 104 106 return null; 105 107 } 108 + 109 + 110 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 111 + 112 + 113 + public function destroyObjectPermanently( 114 + PhabricatorDestructionEngine $engine) { 115 + 116 + $this->openTransaction(); 117 + $installs = id(new PhabricatorDashboardInstall())->loadAllWhere( 118 + 'dashboardPHID = %s', 119 + $this->getPHID()); 120 + foreach ($installs as $install) { 121 + $install->delete(); 122 + } 123 + 124 + $this->delete(); 125 + $this->saveTransaction(); 126 + } 127 + 106 128 107 129 }
+14 -1
src/applications/dashboard/storage/PhabricatorDashboardPanel.php
··· 7 7 extends PhabricatorDashboardDAO 8 8 implements 9 9 PhabricatorPolicyInterface, 10 - PhabricatorCustomFieldInterface { 10 + PhabricatorCustomFieldInterface, 11 + PhabricatorDestructibleInterface { 11 12 12 13 protected $name; 13 14 protected $panelType; ··· 129 130 public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) { 130 131 $this->customFields = $fields; 131 132 return $this; 133 + } 134 + 135 + 136 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 137 + 138 + 139 + public function destroyObjectPermanently( 140 + PhabricatorDestructionEngine $engine) { 141 + 142 + $this->openTransaction(); 143 + $this->delete(); 144 + $this->saveTransaction(); 132 145 } 133 146 134 147 }