diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php index d45c0e03ec..e3f9924f2f 100644 --- a/src/applications/conpherence/editor/ConpherenceEditor.php +++ b/src/applications/conpherence/editor/ConpherenceEditor.php @@ -45,8 +45,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { } if (!$errors) { - $conpherence->openTransaction(); - $conpherence->save(); $xactions = array(); $xactions[] = id(new ConpherenceTransaction()) ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS) @@ -74,7 +72,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { ->setActor($creator) ->applyTransactions($conpherence, $xactions); - $conpherence->saveTransaction(); } return array($errors, $conpherence); @@ -172,6 +169,24 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { return $lock; } + /** + * We need to apply initial effects IFF the conpherence is new. We must + * save the conpherence first thing to make sure we have an id and a phid. + */ + protected function shouldApplyInitialEffects( + PhabricatorLiskDAO $object, + array $xactions) { + + return !$object->getID(); + } + + protected function applyInitialEffects( + PhabricatorLiskDAO $object, + array $xactions) { + + $object->save(); + } + protected function applyCustomInternalTransaction( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php index b7e13e7db6..607eeea726 100644 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -213,6 +213,10 @@ final class ConpherenceThread extends ConpherenceDAO } public function hasAutomaticCapability($capability, PhabricatorUser $user) { + // this bad boy isn't even created yet so go nuts $user + if (!$this->getID()) { + return true; + } $participants = $this->getParticipants(); return isset($participants[$user->getPHID()]); }