fix: backward compatibility for new session format
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user