Commit 66cff695 authored by Aaron Wells's avatar Aaron Wells
Browse files

Make Publish/Unpublishing a blog entry, fire saveartefact event

Bug 1401210. In order for a newly published blog entry (using the
"publish" button) to be able to trigger a watchlist notification,
it needs to fire a saveartefact event, and update the view_artefact
table, the same as the standard route for editing/creating a blog
entry. So the best way to do that is to use the same commit() method.

Change-Id: I35b93d6f7415ae69ed8eede3e10306b712ea1b68
parent efb321c3
......@@ -997,17 +997,9 @@ class ArtefactTypeBlogPost extends ArtefactType {
return false;
}
$data = (object)array(
'blogpost' => $this->id,
'published' => (int) $newpoststatus
);
$this->set('published', (int) $newpoststatus);
$this->commit();
if (get_field('artefact_blog_blogpost', 'COUNT(*)', 'blogpost', $this->id)) {
update_record('artefact_blog_blogpost', $data, 'blogpost');
}
else {
insert_record('artefact_blog_blogpost', $data);
}
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment