From 446a78cd4a279b63389f008c18fbc479604c375b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 3 Sep 2006 22:30:13 +0000 Subject: [PATCH] notice() should be allowed at install/upgrade. It stops the whole process without need to do it. Changed to notify() --- mod/forum/db/mysql.php | 8 ++++---- mod/forum/db/postgres7.php | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mod/forum/db/mysql.php b/mod/forum/db/mysql.php index a1d890df73..821b4a364f 100644 --- a/mod/forum/db/mysql.php +++ b/mod/forum/db/mysql.php @@ -238,19 +238,19 @@ function forum_upgrade($oldversion) { if ($forums = get_records('forum')) { if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) { - notice('Default student role was not found. Roles and permissions '. + notify('Default student role was not found. Roles and permissions '. 'for all your forums will have to be manually set after '. 'this upgrade.'); } if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) { - notice('Default guest role was not found. Roles and permissions '. + notify('Default guest role was not found. Roles and permissions '. 'for teacher forums will have to be manually set after '. 'this upgrade.'); } foreach ($forums as $forum) { if (!forum_convert_to_roles($forum, $forummod->id, $studentroles, $guestroles)) { - notice('Forum with id '.$forum->id.' was not upgraded'); + notify('Forum with id '.$forum->id.' was not upgraded'); } } // We need to rebuild all the course caches to refresh the state of @@ -282,4 +282,4 @@ function forum_upgrade($oldversion) { } -?> \ No newline at end of file +?> diff --git a/mod/forum/db/postgres7.php b/mod/forum/db/postgres7.php index 204d139fd1..f3f98d9e81 100644 --- a/mod/forum/db/postgres7.php +++ b/mod/forum/db/postgres7.php @@ -188,12 +188,12 @@ function forum_upgrade($oldversion) { if ($forums = get_records('forum')) { if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) { - notice('Default student role was not found. Roles and permissions '. + notify('Default student role was not found. Roles and permissions '. 'for all your forums will have to be manually set after '. 'this upgrade.'); } if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) { - notice('Default guest role was not found. Roles and permissions '. + notify('Default guest role was not found. Roles and permissions '. 'for teacher forums will have to be manually set after '. 'this upgrade.'); } @@ -201,7 +201,7 @@ function forum_upgrade($oldversion) { foreach ($forums as $forum) { if (!forum_convert_to_roles($forum, $forummod->id, $studentroles, $guestroles)) { - notice('Forum with id '.$forum->id.' was not upgraded'); + notify('Forum with id '.$forum->id.' was not upgraded'); } } @@ -228,19 +228,19 @@ function forum_upgrade($oldversion) { if ($forums = get_records('forum')) { if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) { - notice('Default student role was not found. Roles and permissions '. + notify('Default student role was not found. Roles and permissions '. 'for all your forums will have to be manually set after '. 'this upgrade.'); } if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) { - notice('Default guest role was not found. Roles and permissions '. + notify('Default guest role was not found. Roles and permissions '. 'for teacher forums will have to be manually set after '. 'this upgrade.'); } foreach ($forums as $forum) { if (!forum_convert_to_roles($forum, $forummod->id, $studentroles, $guestroles)) { - notice('Forum with id '.$forum->id.' was not upgraded'); + notify('Forum with id '.$forum->id.' was not upgraded'); } } // We need to rebuild all the course caches to refresh the state of @@ -272,4 +272,4 @@ function forum_upgrade($oldversion) { } -?> \ No newline at end of file +?> -- 2.39.5