mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Solves error in discovering services module (#14939)
* Solves error discovering services module * Removing trailing spaces * Allow in device group scopes to accept an array * Fix and optimize queries a little --------- Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -321,8 +321,8 @@ class ServiceTemplateController extends Controller
|
||||
ServiceTemplateController::applyDeviceGroups($template);
|
||||
|
||||
// remove any remaining services no longer in the correct device group
|
||||
foreach (Device::notInServiceTemplate($template->id)->notInDeviceGroup($template->groups)->get() as $device) {
|
||||
Service::where('device_id', $device->device_id)->where('service_template_id', $template->id)->delete();
|
||||
foreach (Device::notInServiceTemplate($template->id)->notInDeviceGroup($template->groups->pluck('id'))->pluck('device_id') as $device_id) {
|
||||
Service::where('device_id', $device_id)->where('service_template_id', $template->id)->delete();
|
||||
}
|
||||
$msg = __('All Service Templates have been applied');
|
||||
|
||||
|
Reference in New Issue
Block a user