diff --git a/src/main/java/alfio/manager/AccessService.java b/src/main/java/alfio/manager/AccessService.java index 7a9447f78..e251bde66 100644 --- a/src/main/java/alfio/manager/AccessService.java +++ b/src/main/java/alfio/manager/AccessService.java @@ -584,7 +584,7 @@ public void checkEventAndReservationOwnership(Principal principal, String eventN var eventAndOrgId = checkEventOwnership(principal, eventName); int countExisting; if (partialIds) { - countExisting = reservationRepository.countReservationWithShortIdsForEvent(List.copyOf(reservationIds), eventAndOrgId.getId()); + countExisting = reservationRepository.countReservationWithShortIdsForEvent(reservationIds.stream().map(String::toLowerCase).toList(), eventAndOrgId.getId()); } else { countExisting = reservationRepository.countReservationsWithEventId(reservationIds, eventAndOrgId.getId()); } diff --git a/src/main/java/alfio/repository/TicketReservationRepository.java b/src/main/java/alfio/repository/TicketReservationRepository.java index 82fcf75a7..7f32c0f23 100644 --- a/src/main/java/alfio/repository/TicketReservationRepository.java +++ b/src/main/java/alfio/repository/TicketReservationRepository.java @@ -331,7 +331,7 @@ int updateVatStatus(@Bind("reservationId") String reservationId, @Query(""" - SELECT count(id) from tickets_reservation where id ilike ANY( + SELECT count(id) from tickets_reservation where id like ANY( select s || '%' from unnest(:ids::text[]) s(s) ) and event_id_fk = :eventId """)