Skip to content

Commit

Permalink
Fixed #9370 - listbox custom fields not decryoted on edit
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Apr 6, 2021
1 parent 7da3244 commit 390403d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,9 @@ public static function array_smart_fetch(array $array, $key, $default = '')


/**
* Gracefully handle decrypting the legacy data (encrypted via mcrypt) and use the new
* decryption method instead.
* Gracefully handle decrypting encrypted fields (custom fields, etc).
*
* This is not currently used, but will be.
* @todo allow this to handle more than just strings (arrays, etc)
*
* @author A. Gianotto
* @since 3.6
Expand Down
4 changes: 2 additions & 2 deletions resources/views/models/custom_fields_form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@if ($field->element!='text')
<!-- Listbox -->
@if ($field->element=='listbox')
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
Request::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : $field->defaultValue($model->id))), ['class'=>'format select2 form-control']) }}
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
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']) }}

@elseif ($field->element=='textarea')
<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>
Expand Down

0 comments on commit 390403d

Please sign in to comment.