-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fixed accessories and consumables not being logged correctly during bulk check-in #15221
Conversation
# Conflicts: # app/Http/Controllers/Users/BulkUsersController.php
PR Summary
|
# Conflicts: # app/Http/Controllers/Users/BulkUsersController.php
private function logAccessoriesCheckin(Collection $accessoryUserRows): void | ||
{ | ||
foreach ($accessoryUserRows as $accessoryUserRow) { | ||
$logAction = new Actionlog(); | ||
$logAction->item_id = $accessoryUserRow->accessory_id; | ||
$logAction->item_type = Accessory::class; | ||
$logAction->target_id = $accessoryUserRow->assigned_to; | ||
$logAction->target_type = User::class; | ||
$logAction->user_id = Auth::id(); | ||
$logAction->note = 'Bulk checkin items'; | ||
$logAction->logaction('checkin from'); | ||
} | ||
} | ||
|
||
private function logConsumablesCheckin(Collection $consumableUserRows): void | ||
{ | ||
foreach ($consumableUserRows as $consumableUserRow) { | ||
$logAction = new Actionlog(); | ||
$logAction->item_id = $consumableUserRow->consumable_id; | ||
$logAction->item_type = Consumable::class; | ||
$logAction->target_id = $consumableUserRow->assigned_to; | ||
$logAction->target_type = User::class; | ||
$logAction->user_id = Auth::id(); | ||
$logAction->note = 'Bulk checkin items'; | ||
$logAction->logaction('checkin from'); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not loving the duplication but there is enough difference that using explicit method names instead of passing a handful of parameters is cleaner I think
Description
This PR fixes an issue where accessories and consumables being bulk checked in were not being logged correctly. See this comment for more details.
In the process the PR adds tests around the
destroy
method inBulkUsersController
.Fixes #15109
Type of change