1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Minor, allow feed stories to publish with no related PHIDs (commits, future notifications).

This commit is contained in:
epriestley 2012-06-26 05:48:14 -07:00
parent 111ecabc5f
commit b3900a399c

View file

@ -61,10 +61,6 @@ final class PhabricatorFeedStoryPublisher {
}
public function publish() {
if (!$this->relatedPHIDs) {
throw new Exception("There are no PHIDs related to this story!");
}
if (!$this->storyType) {
throw new Exception("Call setStoryType() before publishing!");
}
@ -78,6 +74,7 @@ final class PhabricatorFeedStoryPublisher {
$story->setChronologicalKey($chrono_key);
$story->save();
if ($this->relatedPHIDs) {
$ref = new PhabricatorFeedStoryReference();
$sql = array();
@ -95,6 +92,7 @@ final class PhabricatorFeedStoryPublisher {
'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %Q',
$ref->getTableName(),
implode(', ', $sql));
}
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
$this->insertNotifications($chrono_key);