fix: backward compatibility for new session format

This commit is contained in:
Björn Fromme
2026-03-16 12:03:00 +01:00
parent 4e05c94912
commit 78b925daa6
2 changed files with 45 additions and 5 deletions
+10 -5
View File
@@ -377,10 +377,15 @@ class BookingDto
$this->$key = $value;
}
// Create a skeleton Travel with only the ID; BookingService::hydrate()
// replaces this with the full object from cache
$travel = new Travel();
$travel->id = $travelId;
$this->travel = $travel;
// Old sessions (before c373a989) still carry a full Travel object;
// new sessions carry only the int ID. Handle both formats.
// TODO: Remove Travel instance branch once all pre-deploy sessions have expired
if ($travelId instanceof Travel) {
$this->travel = $travelId;
} else {
$travel = new Travel();
$travel->id = $travelId;
$this->travel = $travel;
}
}
}