Skip to content

Commit 390403d

Browse files
committed
Fixed #9370 - listbox custom fields not decryoted on edit
Signed-off-by: snipe <[email protected]>
1 parent 7da3244 commit 390403d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/Helpers/Helper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,9 @@ public static function array_smart_fetch(array $array, $key, $default = '')
774774

775775

776776
/**
777-
* Gracefully handle decrypting the legacy data (encrypted via mcrypt) and use the new
778-
* decryption method instead.
777+
* Gracefully handle decrypting encrypted fields (custom fields, etc).
779778
*
780-
* This is not currently used, but will be.
779+
* @todo allow this to handle more than just strings (arrays, etc)
781780
*
782781
* @author A. Gianotto
783782
* @since 3.6

resources/views/models/custom_fields_form.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
@if ($field->element!='text')
99
<!-- Listbox -->
1010
@if ($field->element=='listbox')
11-
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
12-
Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
11+
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
12+
Request::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
1313

1414
@elseif ($field->element=='textarea')
1515
<textarea class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}">{{ Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))) }}</textarea>

0 commit comments

Comments
 (0)