Skip to content

A free open source IT asset/license management system

Check for whether any of the models have a fieldset

snipe51712bc7d67e
diff --git a/resources/views/models/custom_fields_form_bulk_edit.blade.php b/resources/views/models/custom_fields_form_bulk_edit.blade.php
index 3719dac166..b3bcc0a43c 100644
--- a/resources/views/models/custom_fields_form_bulk_edit.blade.php
+++ b/resources/views/models/custom_fields_form_bulk_edit.blade.php
@@ -1,9 +1,18 @@
@php
//set array up before loop so it doesn't get wiped at every iteration
$fields = [];
+ $anyModelHasCustomFields = 0;
@endphp
-@if (isset($models) && count($models) > 0)
+@foreach($models as $model)
+ @if ($model->fieldset ? $model->fieldset->count() > 0 : false)
+ @php
+ $anyModelHasCustomFields++;
+ @endphp
+ @endif
+@endforeach
+
+@if ($anyModelHasCustomFields > 0)
<fieldset name="custom-fields" class="bottom-padded">
<legend class="highlight">
{{ trans('admin/custom_fields/general.custom_fields') }}