Skip to content

Commit

Permalink
Messages - Add validation of users field before sending message - ref…
Browse files Browse the repository at this point in the history
…s BT#19397
  • Loading branch information
cfasanando committed Dec 15, 2021
1 parent 84f53a6 commit 7dc2ab6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main/messages/new_message.php
Expand Up @@ -183,6 +183,7 @@ function manageForm($default, $select_from_user_list = null, $sent_to = '', $tpl
'url' => api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=find_users',
]
);
$form->addRule('users', get_lang('ThisFieldIsRequired'), 'required');
}
} else {
$form->addElement('hidden', 'hidden_user', $default['users'][0], ['id' => 'hidden_user']);
Expand Down Expand Up @@ -451,10 +452,10 @@ function manageForm($default, $select_from_user_list = null, $sent_to = '', $tpl
if (isset($_POST['hidden_user'])) {
$default['users'] = [$_POST['hidden_user']];
}
$social_right_content .= manageForm($default, null, null, $tpl);
} else {
} /*else {
$social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'), 'error');
}
}*/
$social_right_content .= manageForm($default, null, null, $tpl);
}
}

Expand Down

0 comments on commit 7dc2ab6

Please sign in to comment.