nabeelio / phpvms

virtual airline management
http://www.phpvms.net
Other
170 stars 139 forks source link

Trying to get property 'name' of non-object #824

Closed xPerr0 closed 4 years ago

xPerr0 commented 4 years ago

When i make an report with an aircraft and then i remove the aircraft error incoming going to dashboard or any page where it calls to this "aircraft".

nabeelio commented 4 years ago

Yeah there's an open issue with needing to block the aircraft delete if it's been used

xPerr0 commented 4 years ago

Thanks to fast response, any idea how to fix this issue? Maybe recreating the subfleettype ? Thanks again nabeelio

nabeelio commented 4 years ago

Well you probably have to go directly into the admin (/admin) and remove the PIREP or try to edit it to change the aircraft.

xPerr0 commented 4 years ago

Same error when i try to modify that pirep from admin panel, and i dont see the "button" to remove the pirep :S

nabeelio commented 4 years ago

Sorry - try rejecting it. That will block it from showing up in the frontend.

xPerr0 commented 4 years ago

Still the error, i tried to accepting and rejecting it again and still the error.

nabeelio commented 4 years ago

Ok, I might have to do a patch for you directly to dev

xPerr0 commented 4 years ago

thanks a lot!! <3

nabeelio commented 4 years ago

See if this works out

xPerr0 commented 4 years ago

/resources/views/admin/pireps/fields.blade.php it seems here is the error. I made all changes u told me in the 3 files and still the problem. i let you an gyazo link: https://gyazo.com/41bc59417c22ef37824ac49a75e9ef30

nabeelio commented 4 years ago

Another commit to fix that

xPerr0 commented 4 years ago

Well, im starting to comprend how this works. I cleared the error in fields.blade.php, now says a similar error in pirep_card.blade.php Im still changing the line:

{{ $pirep->aircraft->name }} ({{ $pirep->aircraft->registration }})

for:

{{ optional($pirep->aircraft)->name }} ({{ optional($pirep->aircraft)->registration }})

of all errors. At the moment, with the code that u post, i can enter to modify the pirep, but i still cant delet de manual pirep.

Thanks for fast responding so fast, im still working to solve it!

nabeelio commented 4 years ago

Yes there's another issue, #778, which I need to complete. Maybe I'll do that one soon and that should resolve the main issue

xPerr0 commented 4 years ago

I just solve the issue wich broke the main dashboard website, just adding that u said [optional()] before aircraft name... But i really need the delete button on rejected pireps (manual at least). Thanks for the help, my issue is solved.

Offtopic question: Does it supports (phpvms7) smartCARS 2??

Thanks 4 all nabeelio! ;)

nabeelio commented 4 years ago

It does not support phpvms 7

nabeelio commented 4 years ago

Ok, glad you got it fixed. I'll fix the other issues under that other ticket