mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
Transactions - make customization of TYPE_EDGE optional
Summary: Ref T6403. This does TYPE_EDGE since I just had to deal with T8252. Look like this fixes a few editors (maybe) that would have had fatals with mentions like slowvote and ponder. Test Plan: made a phame post mentioning a task and it worked! joined / left a project, watched / unwatched a project and that worked! blind faith for other sites. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6403 Differential Revision: https://secure.phabricator.com/D12929
This commit is contained in:
parent
7bc008d0e2
commit
16c8d44c37
17 changed files with 17 additions and 42 deletions
|
@ -57,7 +57,6 @@ final class AlmanacDeviceEditor
|
|||
case AlmanacDeviceTransaction::TYPE_INTERFACE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,7 +71,6 @@ final class AlmanacDeviceEditor
|
|||
case AlmanacDeviceTransaction::TYPE_NAME:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
case AlmanacDeviceTransaction::TYPE_INTERFACE:
|
||||
$old = $xaction->getOldValue();
|
||||
|
|
|
@ -63,7 +63,6 @@ final class AlmanacServiceEditor
|
|||
return;
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -78,7 +77,6 @@ final class AlmanacServiceEditor
|
|||
case AlmanacServiceTransaction::TYPE_NAME:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
case AlmanacServiceTransaction::TYPE_LOCK:
|
||||
$service = id(new AlmanacServiceQuery())
|
||||
|
|
|
@ -117,7 +117,6 @@ final class PhabricatorAuditEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorAuditActionConstants::ACTION:
|
||||
case PhabricatorAuditActionConstants::INLINE:
|
||||
case PhabricatorAuditActionConstants::ADD_AUDITORS:
|
||||
|
@ -135,7 +134,6 @@ final class PhabricatorAuditEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorAuditActionConstants::ACTION:
|
||||
case PhabricatorAuditTransaction::TYPE_COMMIT:
|
||||
return;
|
||||
|
|
|
@ -111,7 +111,6 @@ final class PhabricatorCalendarEventEditor
|
|||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
return;
|
||||
}
|
||||
|
@ -154,7 +153,6 @@ final class PhabricatorCalendarEventEditor
|
|||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -68,8 +68,6 @@ final class PhabricatorDashboardPanelTransactionEditor
|
|||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
$object->setEditPolicy($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
|
@ -84,7 +82,6 @@ final class PhabricatorDashboardPanelTransactionEditor
|
|||
case PhabricatorDashboardPanelTransaction::TYPE_ARCHIVE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,8 +115,6 @@ final class PhabricatorDashboardTransactionEditor
|
|||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
$object->setEditPolicy($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
|
@ -132,8 +130,6 @@ final class PhabricatorDashboardTransactionEditor
|
|||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
|
|
|
@ -199,8 +199,6 @@ final class DifferentialTransactionEditor
|
|||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case DifferentialTransaction::TYPE_INLINE:
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
case DifferentialTransaction::TYPE_UPDATE:
|
||||
if (!$this->getIsCloseByCommit()) {
|
||||
switch ($object->getStatus()) {
|
||||
|
@ -581,7 +579,6 @@ final class DifferentialTransactionEditor
|
|||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case DifferentialTransaction::TYPE_ACTION:
|
||||
return;
|
||||
|
|
|
@ -103,7 +103,6 @@ final class FundInitiativeEditor
|
|||
$object->setTotalAsCurrency($total);
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
return;
|
||||
|
@ -157,7 +156,6 @@ final class FundInitiativeEditor
|
|||
$editor->applyTransactions($backer, $subx);
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
return;
|
||||
|
|
|
@ -90,7 +90,6 @@ final class PhabricatorPasteEditor
|
|||
return;
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,7 +108,6 @@ final class PhabricatorPasteEditor
|
|||
case PhabricatorTransactions::TYPE_EDIT_POLICY:
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,8 +64,6 @@ final class PhamePostEditor
|
|||
return $object->setBody($xaction->getNewValue());
|
||||
case PhamePostTransaction::TYPE_COMMENTS_WIDGET:
|
||||
return $object->setCommentsWidget($xaction->getNewValue());
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
|
@ -80,7 +78,6 @@ final class PhamePostEditor
|
|||
case PhamePostTransaction::TYPE_PHAME_TITLE:
|
||||
case PhamePostTransaction::TYPE_BODY:
|
||||
case PhamePostTransaction::TYPE_COMMENTS_WIDGET:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -209,8 +209,6 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||
case PholioTransactionType::TYPE_STATUS:
|
||||
$object->setStatus($xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,8 +276,6 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||
$image->setSequence($value);
|
||||
$image->save();
|
||||
break;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,6 @@ final class PhortuneAccountEditor
|
|||
case PhortuneAccountTransaction::TYPE_NAME:
|
||||
$object->setName($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
return parent::applyCustomInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
@ -61,8 +59,6 @@ final class PhortuneAccountEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhortuneAccountTransaction::TYPE_NAME:
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@ final class PhortuneMerchantEditor
|
|||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION:
|
||||
$object->setDescription($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +73,6 @@ final class PhortuneMerchantEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhortuneMerchantTransaction::TYPE_NAME:
|
||||
case PhortuneMerchantTransaction::TYPE_DESCRIPTION:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -145,8 +145,6 @@ final class PonderQuestionEditor
|
|||
|
||||
$object->setAnswerCount($count);
|
||||
break;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,6 @@ final class PhabricatorProjectTransactionEditor
|
|||
$object->setIsMembershipLocked($xaction->getNewValue());
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
case PhabricatorTransactions::TYPE_VIEW_POLICY:
|
||||
$object->setViewPolicy($xaction->getNewValue());
|
||||
|
@ -170,6 +169,20 @@ final class PhabricatorProjectTransactionEditor
|
|||
case PhabricatorProjectTransaction::TYPE_COLOR:
|
||||
case PhabricatorProjectTransaction::TYPE_LOCKED:
|
||||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyBuiltinExternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
$old = $xaction->getOldValue();
|
||||
$new = $xaction->getNewValue();
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
$edge_type = $xaction->getMetadataValue('edge:type');
|
||||
switch ($edge_type) {
|
||||
|
@ -225,7 +238,7 @@ final class PhabricatorProjectTransactionEditor
|
|||
return;
|
||||
}
|
||||
|
||||
return parent::applyCustomExternalTransaction($object, $xaction);
|
||||
return parent::applyBuiltinExternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
protected function validateTransaction(
|
||||
|
|
|
@ -102,8 +102,6 @@ final class PhabricatorSlowvoteEditor
|
|||
case PhabricatorSlowvoteTransaction::TYPE_CLOSE:
|
||||
$object->setIsClosed((int)$xaction->getNewValue());
|
||||
break;
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -402,6 +402,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
$field = $this->getCustomFieldForTransaction($object, $xaction);
|
||||
return $field->applyApplicationTransactionInternalEffects($xaction);
|
||||
case PhabricatorTransactions::TYPE_INLINESTATE:
|
||||
case PhabricatorTransactions::TYPE_EDGE:
|
||||
return $this->applyBuiltinInternalTransaction($object, $xaction);
|
||||
}
|
||||
|
||||
|
@ -493,7 +494,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
}
|
||||
|
||||
$editor->save();
|
||||
break;
|
||||
return $this->applyBuiltinExternalTransaction($object, $xaction);
|
||||
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
|
||||
$field = $this->getCustomFieldForTransaction($object, $xaction);
|
||||
return $field->applyApplicationTransactionExternalEffects($xaction);
|
||||
|
|
Loading…
Reference in a new issue