Commit 19fff5d6 authored by Son Nguyen's avatar Son Nguyen Committed by Robert Lyon
Browse files

Bug 1629105: Update the option 'Multiple journals' in session

behatnotneeded

Change-Id: Icab9024d0df59194221eae71910996506d004140
(cherry picked from commit ff3db865)
parent ce0d0fa3
......@@ -428,6 +428,7 @@ class LeapImportBlog extends LeapImportArtefactPlugin {
* Deletes the default blog that is created for all users
*/
public static function cleanup(PluginImportLeap $importer) {
global $USER;
if (self::$importedablog && self::$firstblogid) {
$blog = artefact_instance_from_id(self::$firstblogid);
if (!$blog->has_children()) { // TODO see #544160
......@@ -437,6 +438,9 @@ class LeapImportBlog extends LeapImportArtefactPlugin {
$userid = $importer->get('usr');
if (count_records('artefact', 'artefacttype', 'blog', 'owner', $userid) != 1) {
set_account_preference($userid, 'multipleblogs', 1);
if ($userid == $USER->get('id')) {
$USER->set_account_preference('multipleblogs', 1);
}
}
}
......
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