-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when saving a PIREP without filling some fields and attempting to edit it #414
Comments
@buske-it Can you try the latest dev version from the repo or from here? I think I had addressed that. If you still see it in dev, I'll mark it as a proper bug and fix it. Thanks!! |
Is there an easy way to upgrade the current install? The manual is not mentioning anything... Also, I have tried to download the above package this morning and uploaded it... However, it would come up only with a blank page... nothing else... no installer... Anything I am missing here? Let me know and I will be happy to test it for you. Cheers |
You should just have to overwrite the files. Blank page, nothing in storage/logs? |
I just uploaded it into a test directory and just get a blank page where the installer should be. It works fine with the regular download. Anyway, I made a backup. Tomorrow I will do it as you mentioned it, just overwriting the files. Give me until later in the morning and I will let you know if it worked. |
Hi Nabeel, as I mentioned on Discord, I have checked now and the error still exists in the latest dev version. This in return causes a PHP error when you try to edit the PIREP after saving it: It is calling function load() on null, which is not possible. Assigning an aircraft ID manually via phpmyadmin to the PIREP fixes the issue. I suggest making the aircraft field required as well. That way you are forcing the user to fill it out, preventing the error. To reproduce: File a manual PIREP and leave the aircraft field default (blank) as it is. Save the PIREP then try to edit it. The above PHP error comes up. Cheers |
Describe the bug
Hi @nabeel,
By default, when you open the manual PIREP form, there are no required fields. In our case the issue was the aircraft field. By default, when you load the PIREP form, it will show all fields blank, including the aircraft field. In this particular case, we had saved the PIREP before assigning an aircraft to it, just leaving the field blank. The result was that a NULL entry in the database was created for aircraft ID. When we tried to edit the PIREP the Ooops something went wrong message came up as a PHP error was generated.
Logging into phpMyAdmin, manually changing the NULL value to any valid aircraft ID makes the EDIT form come up normally and without an error. I could imagine that the error would occur as well if other fields were left empty and get assigned NULL as a result.
My suggestion would be to either mark those fields as required, hence preventing a PIREP to be saved without all required information entered first, or have the fields contain some kind of default value, which is accepted by the database. In the case of Aircraft maybe something like "Please select Aircraft" which is assigned ID 1... or possibly as a third option, go ahead and change the mySQL table in such a way, that the value NULL is accepted and no longer causing an error.
I hope this helps you.
Version
7.0.0.0 Beta
To Reproduce
Just go to file a manual PIREP and leave the aircraft field (or possibly other fields but not tested) blank, save the PIREP and then try to Edit it again.
Expected behavior
The PIREP Edit form should open without any error, allowing to edit / submit the manual PIREP.
The text was updated successfully, but these errors were encountered: