Skip to content

Commit

Permalink
notice() should be allowed at install/upgrade. It stops the whole
Browse files Browse the repository at this point in the history
process without need to do it. Changed to notify()
  • Loading branch information
stronk7 committed Sep 3, 2006
1 parent 56b4d70 commit 446a78c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions mod/forum/db/mysql.php
Expand Up @@ -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
Expand Down Expand Up @@ -282,4 +282,4 @@ function forum_upgrade($oldversion) {
}


?>
?>
14 changes: 7 additions & 7 deletions mod/forum/db/postgres7.php
Expand Up @@ -188,20 +188,20 @@ 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');
}
}

Expand All @@ -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
Expand Down Expand Up @@ -272,4 +272,4 @@ function forum_upgrade($oldversion) {
}


?>
?>

0 comments on commit 446a78c

Please sign in to comment.