Closed walkerairtrans closed 1 year ago
Can you provide more detailed steps to reproduce? We are not having this issue with the steps you have provided.
I'll test it again later tonight but the last 3 tests resulted in the same--no route submitted with the PIREP.
I put the route in smartCARS 3 before clicking fly. I see the route posting to my acarsdata (where updates are sent). But when I file the PIREP the route doesn't come across with the payload.
Just curious. Are you expecting a route to exist in the flight schedule? Because looking at your code I see you are taking the route from a schedule you download from the database. That isn't the best approach because not everyone has routes in their schedules on their platform. It doesn't seem to appear that the route box on the app does anything except send it with the update.php.
That is my assumption as to why I don't see it. I imagine if I stuck a route in some random schedule it would take that to the PIREP.
I'm assuming this based on what I see on complete.php
$route = $database->fetch('SELECT code, flightnum, depicao, arricao, route, aircraft FROM ' . dbPrefix . 'schedules WHERE id=?', array($bids[0]['routeid']));
$data = array( 'pilotid' => $pilotID, 'code' => $route[0]['code'], 'flightnum' => $route[0]['flightnum'], 'depicao' => $route[0]['depicao'], 'arricao' => $route[0]['arricao'], 'route' => $route[0]['route'], 'aircraft' => $route[0]['aircraft'], 'load' => $_POST['remainingLoad'], 'flighttime' => sprintf('%02d:%02d', floor($_POST['flightTime']), round(($_POST['flightTime'] - floor($_POST['flightTime'])) 60)), 'landingrate' => $_POST['landingRate'], 'submitdate' => date('Y-m-d H:i:s'), 'fuelused' => $_POST['fuelUsed'], 'source' => 'smartCARS 3', 'log' => implode('', $_POST['flightLog']) );
I believe we have resolved this with the recent updates. Please re-open/re-report if not.
Looks like this is still a problem @turbofandude
Route was entered into smartCARS, but when the PIREP was submitted the route field was empty.
Complete.php is still using this:
'route' => $route[0]['route'],
and backtracing call is doing a database query for the scheduled flight--looks to be erasing the route if you are sending it from the app.
Not every flight schedule will have a route pre-entered. It would be better to let the app be the source of truth and if it's empty then try the scheduled flight in the database.
Describe the bug I can't remember if I submitted this or not; but when sending your PIREP, the route is not copied with the app.
You can see in the payload sent to the server there is no route (it's blank.)
{"pilotid":100,"code":"WAE","flightnum":"3603","depicao":"KELP","arricao":"KMAF","route":"","aircraft":"106","load":"4","flighttime":"01:18","landingrate":"-76.8946875","submitdate":"2023-04-05 15:16:20","fuelused":"117","source":"smartCARS 3","log":"2023-04-05T13:56:04.876Z - Flying Black Square A36 Bonanza Turbo WAT Black Red2023-04-05T13:57:59.279Z - Engine 1 On2023-04-05T14:01:34.883Z - Flight phase set to push back2023-04-05T14:01:44.974Z - Flight phase set to taxi2023-04-05T14:04:43.883Z - Flight phase set to take off2023-04-05T14:04:54.999Z - Flight phase set to climb2023-04-05T14:05:04.093Z - Gear lever raised2023-04-05T14:15:59.229Z - Flight phase set to cruise2023-04-05T14:31:16.813Z - Paused2023-04-05T14:31:24.962Z - Unpaused2023-04-05T14:59:37.377Z - Flight phase set to descent2023-04-05T15:04:27.657Z - Flight phase set to final2023-04-05T15:09:25.978Z - Gear lever lowered2023-04-05T15:09:34.061Z - Flaps set to 50%2023-04-05T15:11:39.344Z - Flight phase set to landed2023-04-05T15:12:10.648Z - Flaps set to 0%2023-04-05T15:12:15.715Z - Flight phase set to taxi to_gate2023-04-05T15:16:02.135Z - Engine 1 Off2023-04-05T15:16:02.135Z - Flight phase set to deboarding","comment":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"}
To Reproduce Steps to reproduce the behavior:
Expected behavior If you enter a route in the app, it should also be sent with the final PIREP.
Screenshots N/A
System Information (please complete the following information):
Additional context N/A