fix: correct edit reload dirty-state

This commit is contained in:
Björn Fromme
2026-07-10 14:33:09 +02:00
parent 99b6876ce2
commit 0ea43d0c6b
2 changed files with 231 additions and 5 deletions
@@ -94,7 +94,13 @@ class IndexController extends AbstractController
return $this->redirectToRoute('app_bookings');
}
$wasDirtyBeforePreselection = $this->fingerprintService->isDirty($bookingDto);
$this->bookingConfigurator->preselectDefaultServices($bookingDto);
if (false === $wasDirtyBeforePreselection) {
$bookingDto->originalFingerprint = $this->fingerprintService->generateFingerprint($bookingDto);
}
$this->bookingSessionService->saveBookingDto($request, $bookingDto, BookingDto::MODE_EDIT);
// Show flash message if draft was restored
@@ -142,10 +148,13 @@ class IndexController extends AbstractController
return $this->redirectToRoute('app_booking_edit', ['bookingId' => $bookingId]);
}
$isDirty = $wasDirtyBeforePreselection
|| (true === $isOverviewSubmitted && $this->fingerprintService->isDirty($bookingDto));
$bookingEditContext = $this->editContextFactory->createOverviewContext(
$bookingDto,
$bookingData,
$this->fingerprintService->isDirty($bookingDto),
$isDirty,
$isOverviewSubmitted,
$hasBlockingValidationErrors,
$missingValueLabelsByParticipantIndex,
@@ -215,6 +224,7 @@ class IndexController extends AbstractController
/** @var User $user */
$user = $this->getUser();
$this->draftService->deleteDraft($user, $bookingId);
$this->dataLoader->invalidateBookingCache($bookingId, $user);
$this->addFlash('success', 'Änderungen verworfen, Daten neu geladen');