bbuske Posted January 23, 2019 Report Share Posted January 23, 2019 Hello, when people try to edit a PIREP after they have sent it, an error is coming up about a missing function. While this would be nice to work, editing PIREPs is not really necessary anyway. So I wonder if there is an option to disable it somewhere. I know there was an app.config file in V5 but I have not found something similar in V7. Any help is appreciated. Cheers Quote Link to comment Share on other sites More sharing options...
Heritage1 Posted July 7, 2019 Report Share Posted July 7, 2019 Hello and sorry the lack of time here, Just this moment saw your post. I have disabled mine a very long time ago, there is no reason what so ever a Pilot should edit a filed PIREP. there are 2 ways to disable this very easily. The very easy way is this; <?php // Only show this column if they're logged in, and the pilot viewing is the // owner/submitter of the PIREPs if(Auth::LoggedIn() && Auth::$pilot->pilotid == $pirep->pilotid) { ?> <td align="right"> <a href="<?php echo url('/pireps/addcomment?id='.$pirep->pirepid);?>">Add Comment</a><br /> <a href="<?php echo url('/pireps/editpirep?id='.$pirep->pirepid);?>">Edit PIREP</a> </td> <?php } ?> <?php // Only show this column if they're logged in, and the pilot viewing is the // owner/submitter of the PIREPs if(Auth::LoggedIn() && Auth::$pilot->pilotid == $pirep->pilotid) { ?> <!--<td align="right"> <a href="<?php echo url('/pireps/addcomment?id='.$pirep->pirepid);?>">Add Comment</a><br /> <a href="<?php echo url('/pireps/editpirep?id='.$pirep->pirepid);?>">Edit PIREP</a> </td>--> <?php } ?> First paragraph is what you have, you will see in the second paragraph a simple remarked "OUT", this remarks out the visible Add comment and Edit PIREP lines, this is the easy way of using a remark jesture for HTML and/or php, the <!-- //// my stuff //// --> remarks out anything in between the <!-- and the --> REMEMBER IMPORTANT type it exactly the way I've got it for the 2 remarks, the <!-- and --> are the remark calls.... Hope this helps anyone. Quote Link to comment Share on other sites More sharing options...
Moderators shakamonkey88 Posted July 7, 2019 Moderators Report Share Posted July 7, 2019 Almost, but with that, he'll lost the ability for his pilots to write a comment. It'd be better to just comment out the "edit PIREP" link: <td align="right"> <a href="<?php echo url('/pireps/addcomment?id='.$pirep->pirepid);?>">Add Comment</a><br /> <!––<a href="<?php echo url('/pireps/editpirep?id='.$pirep->pirepid);?>">Edit PIREP</a>––> </td> Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted July 7, 2019 Administrators Report Share Posted July 7, 2019 What file is this code in - in version 7? Quote Link to comment Share on other sites More sharing options...
Moderators shakamonkey88 Posted July 8, 2019 Moderators Report Share Posted July 8, 2019 No you're right, OP is asking about v7. I just thought I'd chip in about Jim's code. I haven't really had a look at v7. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted July 8, 2019 Administrators Report Share Posted July 8, 2019 (edited) Well, no wonder that code looked familiar. Yeah - I haven't really had a good look at v7 either. Edited July 8, 2019 by ProAvia Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted July 17, 2019 Administrators Report Share Posted July 17, 2019 In v7, there is a read-only mode which is active after it's been accepted/rejected or cancelled. It can still be edited beforehand, in case there's some additions that need to be added - mainly custom fields or pax/cargo counts which may not get filled in through ACARS Quote Link to comment Share on other sites More sharing options...
bbuske Posted October 23, 2019 Author Report Share Posted October 23, 2019 On 7/17/2019 at 7:55 AM, Nabeel said: In v7, there is a read-only mode which is active after it's been accepted/rejected or cancelled. It can still be edited beforehand, in case there's some additions that need to be added - mainly custom fields or pax/cargo counts which may not get filled in through ACARS Still, when pilots try to edit a PIREP after sending it or even saving it, a PHP error shows up and it says Ooops something went wrong. It would be nice to disable that option so it doesn't appear or to let the pilot know he is not allowed to edit a PIREP. That error message doesn't look nice.. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 24, 2019 Administrators Report Share Posted October 24, 2019 12 hours ago, bbuske said: Still, when pilots try to edit a PIREP after sending it or even saving it, a PHP error shows up and it says Ooops something went wrong. It would be nice to disable that option so it doesn't appear or to let the pilot know he is not allowed to edit a PIREP. That error message doesn't look nice.. That means there was an error that shouldn't have happened. Can you replicate it and then upload the storage/logs/laravel.log file here so I can see what the error is? If you can post an issue on Github, that will be the easiest way for me to keep track. Quote Link to comment Share on other sites More sharing options...
bbuske Posted October 24, 2019 Author Report Share Posted October 24, 2019 Hi @Nabeel, I am able to reproduce the error and I found a solution for it. 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. Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.