MDL-47065 notes: prevent empty spaces added as note
(And updated behat test for this test case)
This commit is contained in:
committed by
David Monllao
parent
55d5b4168e
commit
184169cd76
+3
-2
@@ -55,11 +55,12 @@ if (!empty($users) && confirm_sesskey()) {
|
||||
$note->format = FORMAT_PLAIN;
|
||||
foreach ($users as $k => $v) {
|
||||
$user = $DB->get_record('user', array('id' => $v));
|
||||
if (!$user || empty($contents[$k])) {
|
||||
$content = trim($contents[$k]);
|
||||
if (!$user || empty($content)) {
|
||||
continue;
|
||||
}
|
||||
$note->id = 0;
|
||||
$note->content = $contents[$k];
|
||||
$note->content = $content;
|
||||
$note->publishstate = $states[$k];
|
||||
$note->userid = $v;
|
||||
note_save($note);
|
||||
|
||||
Reference in New Issue
Block a user