diff --git a/backend/app/Validators/Rules/AttendeeQuestionRule.php b/backend/app/Validators/Rules/AttendeeQuestionRule.php index c87e49a6..87640c9e 100644 --- a/backend/app/Validators/Rules/AttendeeQuestionRule.php +++ b/backend/app/Validators/Rules/AttendeeQuestionRule.php @@ -2,9 +2,9 @@ namespace HiEvents\Validators\Rules; +use HiEvents\DomainObjects\QuestionDomainObject; use Illuminate\Support\Collection; use Illuminate\Validation\ValidationException; -use HiEvents\DomainObjects\QuestionDomainObject; class AttendeeQuestionRule extends BaseQuestionRule { @@ -20,6 +20,7 @@ protected function validateRequiredQuestionArePresent(Collection $orderAttendees $requiredQuestionIds = $this->questions ->filter(function (QuestionDomainObject $question) use ($ticketId) { return $question->getRequired() + && !$question->getIsHidden() && $question->getTickets()?->map(fn($ticket) => $ticket->getId())->contains($ticketId); }) ->map(fn(QuestionDomainObject $question) => $question->getId());