Merge branch 'fix/Merge_develop_master_comments' into 'develop'

Fix : L'ajout de commentaire ne fonctionne pas avec un sondage nommé.

Deux problèmes corrigés : 
 - En cas d'erreur d'ajout d'un commentaire, le message n'était pas montré
 - On ne prenait pas en compte la possibilité que le sondage puisse être appelé par son nom et pas par son ID

See merge request !105
This commit is contained in:
Olivier Perez 2016-03-05 17:45:13 +01:00
commit ee80682223
3 changed files with 4 additions and 4 deletions

View File

@ -52,10 +52,8 @@ $securityService = new SecurityService();
if (!empty($_POST['poll'])) { if (!empty($_POST['poll'])) {
$poll_id = filter_input(INPUT_POST, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]); $poll_id = filter_input(INPUT_POST, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
if (strlen($poll_id) === 16) {
$poll = $pollService->findById($poll_id); $poll = $pollService->findById($poll_id);
} }
}
if (!$poll) { if (!$poll) {
$message = new Message('error', __('Error', 'This poll doesn\'t exist !')); $message = new Message('error', __('Error', 'This poll doesn\'t exist !'));

View File

@ -28,6 +28,7 @@ use Framadate\Services\MailService;
use Framadate\Services\PollService; use Framadate\Services\PollService;
use Framadate\Services\NotificationService; use Framadate\Services\NotificationService;
use Framadate\Security\PasswordHasher; use Framadate\Security\PasswordHasher;
use Framadate\Utils;
include_once __DIR__ . '/app/inc/init.php'; include_once __DIR__ . '/app/inc/init.php';

View File

@ -74,6 +74,7 @@ $(document).ready(function () {
newMessage newMessage
.find('.contents') .find('.contents')
.text(data.message.message); .text(data.message.message);
newMessage.removeClass('hidden');
var commentsAlert = $('#comments_alerts'); var commentsAlert = $('#comments_alerts');
commentsAlert commentsAlert
.empty() .empty()