Minor, allow feed stories to publish with no related PHIDs (commits, future notifications).
This commit is contained in:
@@ -61,10 +61,6 @@ final class PhabricatorFeedStoryPublisher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function publish() {
|
public function publish() {
|
||||||
if (!$this->relatedPHIDs) {
|
|
||||||
throw new Exception("There are no PHIDs related to this story!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->storyType) {
|
if (!$this->storyType) {
|
||||||
throw new Exception("Call setStoryType() before publishing!");
|
throw new Exception("Call setStoryType() before publishing!");
|
||||||
}
|
}
|
||||||
@@ -78,6 +74,7 @@ final class PhabricatorFeedStoryPublisher {
|
|||||||
$story->setChronologicalKey($chrono_key);
|
$story->setChronologicalKey($chrono_key);
|
||||||
$story->save();
|
$story->save();
|
||||||
|
|
||||||
|
if ($this->relatedPHIDs) {
|
||||||
$ref = new PhabricatorFeedStoryReference();
|
$ref = new PhabricatorFeedStoryReference();
|
||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
@@ -95,6 +92,7 @@ final class PhabricatorFeedStoryPublisher {
|
|||||||
'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %Q',
|
'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %Q',
|
||||||
$ref->getTableName(),
|
$ref->getTableName(),
|
||||||
implode(', ', $sql));
|
implode(', ', $sql));
|
||||||
|
}
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
|
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
|
||||||
$this->insertNotifications($chrono_key);
|
$this->insertNotifications($chrono_key);
|
||||||
|
|||||||
Reference in New Issue
Block a user