Merge pull request #11738 from inietov/fixes/problem_checkin_and_delete_users

Fixed #11695 Problem with checkin all and delete user.
This commit is contained in:
snipe 2022-08-25 17:52:51 -07:00 committed by GitHub
commit 4fd1827576
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,8 +231,14 @@ class BulkUsersController extends Controller
protected function logItemCheckinAndDelete($items, $itemType)
{
foreach ($items as $item) {
$item_id = $item->id;
$logAction = new Actionlog();
$logAction->item_id = $item->id;
if($itemType == License::class){
$item_id = $item->license_id;
}
$logAction->item_id = $item_id;
// We can't rely on get_class here because the licenses/accessories fetched above are not eloquent models, but simply arrays.
$logAction->item_type = $itemType;
$logAction->target_id = $item->assigned_to;