Commit d62429dc authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review

Merge "Fix bug and give better error when multiplejournals"

parents b5e94d57 c84bed6c
......@@ -34,6 +34,10 @@ define('SECTION_PAGE', 'index');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'blog');
if (!$USER->get_account_preference('multipleblogs')) {
redirect(get_config('wwwroot') . 'artefact/blog/view/');
define('TITLE', get_string('blogs',''));
if ($delete = param_integer('delete', 0)) {
......@@ -82,6 +82,7 @@ $string['newattachmentsexceedquota'] = 'The total size of the new files that you
$string['newblog'] = 'New Journal';
$string['newblogpost'] = 'New Journal Entry in Journal "%s"';
$string['newerposts'] = 'Newer entries';
$string['noblogfound'] = 'No default journal found. This is a bug with the system, to fix it you need to enable the multiple journals option on the account settings page.';
$string['nopostsyet'] = 'No entries yet.';
$string['addone'] = 'Add one!';
$string['noimageshavebeenattachedtothispost'] = 'No images have been attached to this entry. You need to upload or attach an image to the entry before you can insert it.';
......@@ -51,7 +51,7 @@ if (is_null($id)) {
'id ASC'
)) {
throw new ParameterException();
throw new ArtefactNotFoundException(get_string('noblogfound', ''));
$id = $records[0]->id;
$blog = new ArtefactTypeBlog($id, $records[0]);
Markdown is supported
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