fix: correct edit reload dirty-state
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user