diff --git a/lib/Alchemy/Phrasea/Application/Lightbox.php b/lib/Alchemy/Phrasea/Application/Lightbox.php index 996e98a550..b0eca1a335 100644 --- a/lib/Alchemy/Phrasea/Application/Lightbox.php +++ b/lib/Alchemy/Phrasea/Application/Lightbox.php @@ -508,13 +508,19 @@ return call_user_func( if ( ! $basket->getValidation()->getParticipant($user)->getCanAgree()) { throw new ControllerException('You have not right to agree'); } + + $agreed = false; /* @var $basket \Entities\Basket */ foreach ($basket->getElements() as $element) { - if (null === $element->getUserValidationDatas($user)->getAgreement()) { - throw new ControllerException(_('You have to give your feedback at least on one document to send a report')); + if (null !== $element->getUserValidationDatas($user)->getAgreement()) { + $agreed = true; } } + if (!$agreed) { + throw new ControllerException(_('You have to give your feedback at least on one document to send a report')); + } + /* @var $basket \Entities\Basket */ $participant = $basket->getValidation()->getParticipant($user);