fix: preserve selected services from booking even when unavailable
When editing a booking, services that were previously booked but are no
longer available in the travel catalog were being dropped. This caused
API error 650 ("Anzahl Leistung stimmt nicht mit Teilnehmerzuordnung
überein") because the service participant counts no longer matched.
The fix ensures that in edit mode, booked services are merged with
travel data services in both:
- Form rendering (ParticipantFieldOptionsProvider): so checkboxes appear
- Handler validation (AbstractParticipantFieldHandler): so selections
are accepted
This allows users to keep their existing service selections or
deliberately replace them with other available options. Create mode
remains unchanged.
This commit is contained in:
@@ -58,7 +58,13 @@ class ParticipantBoardFieldHandler extends AbstractParticipantFieldHandler
|
||||
}
|
||||
|
||||
$selectedBoard = $this->getFieldValue($submittedData, $this->getFieldName()) ?? [];
|
||||
$availableBoard = $bookingDto->travel->getAdditionalServicesBySubTypes(Constants::TOKEN_BOARD);
|
||||
|
||||
// Get available board options from travel data (includes booked options in edit mode)
|
||||
$availableBoard = $this->getAvailableServicesWithBooked(
|
||||
$bookingDto,
|
||||
$participantIndex,
|
||||
Constants::TOKEN_BOARD
|
||||
);
|
||||
|
||||
$validSelections = $this->filterValidServiceSelections(
|
||||
$selectedBoard,
|
||||
|
||||
Reference in New Issue
Block a user