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

Don't downgrade accepts on update (fix "sticky accept")

Summary:
Fixes T12496. Sticky accept was accidentally impacted by the "void" changes in D17566.

Instead, don't always downgrade all accepts/rejects: on update, we only want to downgrade accepts.

Test Plan:
- With sticky accept off, updated an accepted revision: new state is "needs review".
- With sticky accept on, updated an accepted revision: new state is "accepted" (sticky accept working correctly).
- Did "reject" + "request review" to make sure that still works, worked fine.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12496

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

+15 -5
+12 -2
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 339 339 } 340 340 } 341 341 342 - if ($downgrade_accepts || $downgrade_rejects) { 342 + $downgrade = array(); 343 + if ($downgrade_accepts) { 344 + $downgrade[] = DifferentialReviewerStatus::STATUS_ACCEPTED; 345 + } 346 + 347 + if ($downgrade_accepts) { 348 + $downgrade[] = DifferentialReviewerStatus::STATUS_REJECTED; 349 + } 350 + 351 + if ($downgrade) { 343 352 $void_type = DifferentialRevisionVoidTransaction::TRANSACTIONTYPE; 353 + 344 354 $results[] = id(new DifferentialTransaction()) 345 355 ->setTransactionType($void_type) 346 356 ->setIgnoreOnNoEffect(true) 347 - ->setNewValue(true); 357 + ->setNewValue($downgrade); 348 358 } 349 359 350 360 $is_commandeer = false;
+3 -3
src/applications/differential/xaction/DifferentialRevisionVoidTransaction.php
··· 28 28 AND reviewerStatus IN (%Ls)', 29 29 $table_name, 30 30 $object->getPHID(), 31 - $this->getVoidableStatuses()); 31 + $value); 32 32 33 33 return ipull($rows, 'reviewerPHID'); 34 34 } ··· 47 47 'UPDATE %T SET voidedPHID = %s 48 48 WHERE revisionPHID = %s 49 49 AND voidedPHID IS NULL 50 - AND reviewerStatus IN (%Ls)', 50 + AND reviewerPHID IN (%Ls)', 51 51 $table_name, 52 52 $this->getActingAsPHID(), 53 53 $object->getPHID(), 54 - $this->getVoidableStatuses()); 54 + $value); 55 55 } 56 56 57 57 public function shouldHide() {