nabeelio / phpvms

virtual airline management
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
173 stars 144 forks source link

foreach() argument must be of type array|object when creating a Subfleet #1887

Open TheSharedCockpit opened 1 month ago

TheSharedCockpit commented 1 month ago

Describe the bug production.ERROR: foreach() argument must be of type array|object, null given {"userId":1,"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, null given at ...\app\Http\Controllers\Admin\SubfleetController.php:530) [stacktrace]

Version 7.0.0-dev.g583cdea1dd+241013.583cde

To Reproduce Steps to reproduce the behavior:

  1. Create a new Subfleet
  2. Click on 'Save'

Additional context During the first POST there is no Rank associated to the new subfleet, they will (eventually) be added in a second time. I imagine something like this is missing:

if (!empty($request->input('rank_ids'))) {
...
}

(Tested that on my side, it makes the job...)

Laravel Log.txt

FatihKoz commented 1 month ago

Strange, can not reproduce it and never faced an issue when creating subfleets.

image

Latest dev is 7.0.0-dev.g690e8ac161+241015.690e8a did you tried updating and checking with current build.