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

Slowvote - add ability to destroy a poll

Summary: Fixes T5773.

Test Plan: Made a poll and voted on it. Deleted it via ./bin/remove destory V1. No errors and the poll is gone.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5773

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

+24 -1
+24 -1
src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
··· 6 6 PhabricatorSubscribableInterface, 7 7 PhabricatorFlaggableInterface, 8 8 PhabricatorTokenReceiverInterface, 9 - PhabricatorProjectInterface { 9 + PhabricatorProjectInterface, 10 + PhabricatorDestructibleInterface { 10 11 11 12 const RESPONSES_VISIBLE = 0; 12 13 const RESPONSES_VOTERS = 1; ··· 137 138 138 139 public function getUsersToNotifyOfTokenGiven() { 139 140 return array($this->getAuthorPHID()); 141 + } 142 + 143 + /* -( PhabricatorDestructableInterface )----------------------------------- */ 144 + 145 + public function destroyObjectPermanently( 146 + PhabricatorDestructionEngine $engine) { 147 + 148 + $this->openTransaction(); 149 + $choices = id(new PhabricatorSlowvoteChoice())->loadAllWhere( 150 + 'pollID = %d', 151 + $this->getID()); 152 + foreach ($choices as $choice) { 153 + $choice->delete(); 154 + } 155 + $options = id(new PhabricatorSlowvoteOption())->loadAllWhere( 156 + 'pollID = %d', 157 + $this->getID()); 158 + foreach ($options as $option) { 159 + $option->delete(); 160 + } 161 + $this->delete(); 162 + $this->saveTransaction(); 140 163 } 141 164 142 165 }