Fixed validation rules on order extra questions
Change-Id: I49479afce6ede5ac9cb192ee9f8d6e14d6cb0fdd Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
@@ -111,13 +111,12 @@ final class SummitAttendeeFactory
|
||||
|
||||
$extra_questions = $payload['extra_questions'] ?? [];
|
||||
|
||||
$mandatory_questions = $summit->getMandatoryOrderExtraQuestionsByUsage(SummitOrderExtraQuestionTypeConstants::TicketQuestionUsage);
|
||||
if (count($extra_questions) < $mandatory_questions->count()) {
|
||||
throw new ValidationException("You neglected to fill in all mandatory questions for the attendee.");
|
||||
}
|
||||
|
||||
if (count($extra_questions)) {
|
||||
|
||||
// only check if question are populated
|
||||
$mandatory_questions = $summit->getMandatoryOrderExtraQuestionsByUsage(SummitOrderExtraQuestionTypeConstants::TicketQuestionUsage);
|
||||
if (count($extra_questions) < $mandatory_questions->count()) {
|
||||
throw new ValidationException("You neglected to fill in all mandatory questions for the attendee.");
|
||||
}
|
||||
$questions = $summit->getOrderExtraQuestionsByUsage(SummitOrderExtraQuestionTypeConstants::TicketQuestionUsage);
|
||||
if ($questions->count() > 0) {
|
||||
$attendee->clearExtraQuestionAnswers();
|
||||
|
||||
Reference in New Issue
Block a user