aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/actions/blog/save.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-02-23 09:21:44 -0500
committerCash Costello <cash.costello@gmail.com>2013-02-23 09:21:44 -0500
commitf350d90e384a03629f95b1b5be9b7ad603438f46 (patch)
tree358c55635473df7eb73a54f89269e506cec378ce /mod/blog/actions/blog/save.php
parent1a2c97886f7335509ed1e1f65aff4464a32e01eb (diff)
downloadelgg-f350d90e384a03629f95b1b5be9b7ad603438f46.tar.gz
elgg-f350d90e384a03629f95b1b5be9b7ad603438f46.tar.bz2
Fixes #4802 notifications sent when status is newly set to published
Diffstat (limited to 'mod/blog/actions/blog/save.php')
-rw-r--r--mod/blog/actions/blog/save.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 6da70462a..910da9838 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -158,6 +158,11 @@ if (!$error) {
if (($new_post || $old_status == 'draft') && $status == 'published') {
add_to_river('river/object/blog/create', 'create', $blog->owner_guid, $blog->getGUID());
+ // we only want notifications sent when post published
+ register_notification_object('object', 'blog', elgg_echo('blog:newpost'));
+ elgg_trigger_event('publish', 'blog', $blog);
+
+ // reset the creation time for posts that move from draft to published
if ($guid) {
$blog->time_created = time();
$blog->save();