Skip to content

Commit

Permalink
[BUGFIX] Make unique validation work for translated forms
Browse files Browse the repository at this point in the history
Related: #755
  • Loading branch information
mschwemer committed Sep 25, 2024
1 parent 0384b85 commit 57e4c38
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Classes/Domain/Repository/MailRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,22 @@ public function findByMarkerValueForm(string $marker, string $value, Form $form,
{
$query = $this->createQuery();
$query->getQuerySettings()->setIgnoreEnableFields(true);
/** @var FieldRepository $fieldRepository */
$fieldRepository = GeneralUtility::makeInstance(FieldRepository::class);
$field = $fieldRepository->findByMarkerAndForm(
$marker,
$form->getUid()
);
$fieldUid = null;
if ($field !== null ) {
$fieldUid = $field->getUid();
}

$and = [
$query->equals('answers.field', $fieldRepository->findByMarkerAndForm($marker, $form->getUid())),
$query->equals(
'answers.field',
$fieldUid
),
$query->equals('answers.value', $value),
$query->equals('pid', $pageUid),
];
Expand Down

0 comments on commit 57e4c38

Please sign in to comment.