Skip to content

A free open source IT asset/license management system

Fixed weird checkbox display

snipe75a8639a20a1
diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php
index 3a5753b0a2..016d310d78 100644
--- a/app/Models/CustomField.php
+++ b/app/Models/CustomField.php
@@ -287,7 +287,10 @@ class CustomField extends Model
{
$arr = preg_split("/\\r\\n|\\r|\\n/", $this->field_values);
- $result[''] = 'Select '.strtolower($this->format);
+ if (($this->element!='checkbox') && ($this->element!='checkbox')) {
+ $result[''] = 'Select '.strtolower($this->format);
+ }
+
for ($x = 0; $x < count($arr); $x++) {
$arr_parts = explode('|', $arr[$x]);
diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.php
index 638cf62ced..7c906cae41 100644
--- a/resources/views/models/custom_fields_form.blade.php
+++ b/resources/views/models/custom_fields_form.blade.php
@@ -21,7 +21,8 @@
<div>
<label>
- <input type="checkbox" value="1" name="{{ $field->db_column_name() }}[]" class="minimal" {{ Request::old($field->db_column_name()) != '' ? ' checked="checked"' : '' }}> key: {{ $key }} value: {{ $value }}
+ <input type="checkbox" value="1" name="{{ $field->db_column_name() }}[]" class="minimal" {{ Request::old($field->db_column_name()) != '' ? ' checked="checked"' : '' }}>
+ {{ $value }}
</label>
</div>
@endforeach