fix: ensure drop-offs are submitted when same as pickups
This commit is contained in:
@@ -13,7 +13,7 @@ use App\Form\Service\Abstract\AbstractParticipantFieldHandler;
|
||||
*
|
||||
* Drop-off behavior depends on the transportation combination:
|
||||
* - BUS+BUS: drop-off is gated behind a "differentDropOff" checkbox.
|
||||
* When unchecked, BusProNet defaults to the same location as the pickup.
|
||||
* When unchecked, the system assigns the same location as the pickup.
|
||||
* - PKW+BUS: drop-off is shown directly (no pickup field, no checkbox needed).
|
||||
* - BUS+PKW / PKW+PKW: no drop-off applicable, fields are cleared.
|
||||
*/
|
||||
@@ -54,14 +54,15 @@ class ParticipantDropOffFieldHandler extends AbstractParticipantFieldHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if ($hasOutboundBus) {
|
||||
if (true === $hasOutboundBus) {
|
||||
// BUS+BUS: gated by differentDropOff checkbox
|
||||
$checkboxValue = $this->getFieldValue($submittedData, 'differentDropOff');
|
||||
$isChecked = true === $checkboxValue || '1' === $checkboxValue || 1 === $checkboxValue;
|
||||
$isChecked = $this->normalizeCheckboxValue($this->getFieldValue($submittedData, 'differentDropOff'));
|
||||
|
||||
if (false === $isChecked) {
|
||||
$participant->dropOff = null;
|
||||
$participant->differentDropOff = false;
|
||||
$participant->dropOff = null !== $participant->pickup
|
||||
? ($bookingDto->travel->dropOffs[$participant->pickup->id] ?? null)
|
||||
: null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user