Merge pull request #12197 from inietov/fixes/custom_regex_defaults_to_any

Fixed #11682  Custom field type of CUSTOM REGEX defaults back to ANY on editing
This commit is contained in:
snipe 2022-12-05 13:24:22 -08:00 committed by GitHub
commit 9ca40716ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,8 +74,14 @@
<label for="format" class="col-md-4 control-label">
{{ trans('admin/custom_fields/general.field_format') }}
</label>
@php
$field_format = '';
if (stripos($field->format, 'regex') === 0){
$field_format = 'CUSTOM REGEX';
}
@endphp
<div class="col-md-6 required">
{{ Form::select("format",Helper::predefined_formats(), $field->format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>