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

Fix two minor Differential issues

Summary: The JIRA field is currently always enabled. This isn't correct; it
should be disabled if there's no JIRA provider.

We also use the old set of reviewers to compute mail delivery. Instead, reload
the correct set of reviewers before moving on after finalizing transactions.

+24 -14
+4
src/applications/differential/customfield/DifferentialJIRAIssuesField.php
··· 13 13 return 'jira.issues'; 14 14 } 15 15 16 + public function isFieldEnabled() { 17 + return (bool)PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 18 + } 19 + 16 20 public function canDisableField() { 17 21 return false; 18 22 }
+20 -14
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 504 504 PhabricatorLiskDAO $object, 505 505 array $xactions) { 506 506 507 + // Load the most up-to-date version of the revision and its reviewers, 508 + // so we don't need to try to deduce the state of reviewers by examining 509 + // all the changes made by the transactions. Then, update the reviewers 510 + // on the object to make sure we're acting on the current reviewer set 511 + // (and, for example, sending mail to the right people). 512 + 513 + $new_revision = id(new DifferentialRevisionQuery()) 514 + ->setViewer($this->getActor()) 515 + ->needReviewerStatus(true) 516 + ->withIDs(array($object->getID())) 517 + ->executeOne(); 518 + if (!$new_revision) { 519 + throw new Exception( 520 + pht('Failed to load revision from transaction finalization.')); 521 + } 522 + 523 + $object->attachReviewerStatus($new_revision->getReviewerStatus()); 524 + 525 + 507 526 foreach ($xactions as $xaction) { 508 527 switch ($xaction->getTransactionType()) { 509 528 case DifferentialTransaction::TYPE_UPDATE: ··· 527 546 case $status_accepted: 528 547 case $status_revision: 529 548 case $status_review: 530 - // Load the most up-to-date version of the revision and its reviewers, 531 - // so we don't need to try to deduce the state of reviewers by examining 532 - // all the changes made by the transactions. 533 - $new_revision = id(new DifferentialRevisionQuery()) 534 - ->setViewer($this->getActor()) 535 - ->needReviewerStatus(true) 536 - ->withIDs(array($object->getID())) 537 - ->executeOne(); 538 - if (!$new_revision) { 539 - throw new Exception( 540 - pht('Failed to load revision from transaction finalization.')); 541 - } 542 - 543 549 // Try to move a revision to "accepted". We look for: 544 550 // 545 551 // - at least one accepting reviewer who is a user; and ··· 551 557 $has_rejecting_reviewer = false; 552 558 $has_rejecting_older_reviewer = false; 553 559 $has_blocking_reviewer = false; 554 - foreach ($new_revision->getReviewerStatus() as $reviewer) { 560 + foreach ($object->getReviewerStatus() as $reviewer) { 555 561 $reviewer_status = $reviewer->getStatus(); 556 562 switch ($reviewer_status) { 557 563 case DifferentialReviewerStatus::STATUS_REJECTED: