@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 PhabricatorDestructibleInterface in Phame

Summary: Allows Blogs and Posts to be destroyed. Fixes T9756

Test Plan: Test `bin/remove destroy POST` and `bin/remove destroy BLOG` to great success.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9756

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

+33
+2
src/__phutil_library_map__.php
··· 7581 7581 'PhabricatorSubscribableInterface', 7582 7582 'PhabricatorFlaggableInterface', 7583 7583 'PhabricatorProjectInterface', 7584 + 'PhabricatorDestructibleInterface', 7584 7585 'PhabricatorApplicationTransactionInterface', 7585 7586 ), 7586 7587 'PhameBlogArchiveController' => 'PhameBlogController', ··· 7613 7614 'PhabricatorProjectInterface', 7614 7615 'PhabricatorApplicationTransactionInterface', 7615 7616 'PhabricatorSubscribableInterface', 7617 + 'PhabricatorDestructibleInterface', 7616 7618 'PhabricatorTokenReceiverInterface', 7617 7619 ), 7618 7620 'PhamePostCommentController' => 'PhamePostController',
+18
src/applications/phame/storage/PhameBlog.php
··· 7 7 PhabricatorSubscribableInterface, 8 8 PhabricatorFlaggableInterface, 9 9 PhabricatorProjectInterface, 10 + PhabricatorDestructibleInterface, 10 11 PhabricatorApplicationTransactionInterface { 11 12 12 13 const MARKUP_FIELD_DESCRIPTION = 'markup:description'; ··· 318 319 319 320 public function shouldUseMarkupCache($field) { 320 321 return (bool)$this->getPHID(); 322 + } 323 + 324 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 325 + 326 + public function destroyObjectPermanently( 327 + PhabricatorDestructionEngine $engine) { 328 + 329 + $this->openTransaction(); 330 + 331 + $posts = id(new PhamePost()) 332 + ->loadAllWhere('blogPHID = %s', $this->getPHID()); 333 + foreach ($posts as $post) { 334 + $post->delete(); 335 + } 336 + $this->delete(); 337 + 338 + $this->saveTransaction(); 321 339 } 322 340 323 341
+13
src/applications/phame/storage/PhamePost.php
··· 8 8 PhabricatorProjectInterface, 9 9 PhabricatorApplicationTransactionInterface, 10 10 PhabricatorSubscribableInterface, 11 + PhabricatorDestructibleInterface, 11 12 PhabricatorTokenReceiverInterface { 12 13 13 14 const MARKUP_FIELD_BODY = 'markup:body'; ··· 250 251 AphrontRequest $request) { 251 252 252 253 return $timeline; 254 + } 255 + 256 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 257 + 258 + public function destroyObjectPermanently( 259 + PhabricatorDestructionEngine $engine) { 260 + 261 + $this->openTransaction(); 262 + 263 + $this->delete(); 264 + 265 + $this->saveTransaction(); 253 266 } 254 267 255 268