Skip to content

Commit 941b5cc

Browse files
committed
Merge branch 'MDL-63458_37' of https://github.com/rlorenzo/moodle into MOODLE_37_STABLE
2 parents 02bcfb3 + 5cad3e5 commit 941b5cc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

message/tests/behat/message_admin_settings.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Feature: Message admin settings
88
Given the following "users" exist:
99
| username | firstname | lastname | email |
1010
| user1 | User | One | one@example.com |
11+
And the following "courses" exist:
12+
| fullname | shortname | category | groupmode |
13+
| Course 1 | C1 | 0 | 1 |
1114

1215
Scenario: enable site messaging
1316
Given the following config values are set as admin:
@@ -18,6 +21,9 @@ Feature: Message admin settings
1821
And I should see "User One"
1922
And I follow "User One"
2023
And "Add to contacts" "link" should exist
24+
And I am on "Course 1" course homepage
25+
And I navigate to course participants
26+
And the "With selected users..." select box should contain "Send a message"
2127

2228
Scenario: disable site messaging
2329
Given the following config values are set as admin:
@@ -28,3 +34,6 @@ Feature: Message admin settings
2834
And I should see "User One"
2935
And I follow "User One"
3036
And "Add to contacts" "link" should not exist
37+
And I am on "Course 1" course homepage
38+
And I navigate to course participants
39+
And the "With selected users..." select box should not contain "Send a message"

user/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@
292292
'value' => get_string('deselectall')));
293293
echo html_writer::end_tag('div');
294294
$displaylist = array();
295-
$displaylist['#messageselect'] = get_string('messageselectadd');
295+
if (!empty($CFG->messaging)) {
296+
$displaylist['#messageselect'] = get_string('messageselectadd');
297+
}
296298
if (!empty($CFG->enablenotes) && has_capability('moodle/notes:manage', $context) && $context->id != $frontpagectx->id) {
297299
$displaylist['#addgroupnote'] = get_string('addnewnote', 'notes');
298300
}

0 commit comments

Comments
 (0)