Skip to content

Commit

Permalink
pushing to test other branches
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerrlongg committed Feb 22, 2024
1 parent 20dbacd commit 1435865
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/Http/Controllers/Api/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,23 +668,26 @@ public function update(ImageUploadRequest $request, $id)
if (($model) && (isset($model->fieldset))) {
foreach ($model->fieldset->fields as $field) {
$field_val = $request->input($field->db_column, null);

if ($request->has($field->db_column)) {
//if ($field->field_encrypted) {
// // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array
// $field_val_decrypt = Crypt::decrypt($field_val);
// if (is_array($field_val_decrypt)) {
// $field_val_decrypt_imploded = implode(',', $field_val_decrypt);
// $field_val = Crypt::encrypt($field_val_decrypt_imploded);
// } else
// $field_val = Crypt::encrypt($field_val_decrypt);
//
//}
if ($field->field_encrypted == '1') {
if (Gate::allows('admin')) {
$asset->{$field->db_column} = Crypt::encrypt($field_val);
}
}

if ($field->element == 'checkbox') {
//if ($field->field_encrypted) {
// // to not break a bunch of stuff, we must decrypt + implode if the checkbox value is an array
// $field_val_decrypt = Crypt::decrypt($field_val);
// if (is_array($field_val_decrypt)) {
// $field_val_decrypt_imploded = implode(',', $field_val_decrypt);
// $field_val = Crypt::encrypt($field_val_decrypt_imploded);
// } else
// $field_val = Crypt::encrypt($field_val_decrypt);
//
//}

if(is_array($field_val)) {
$field_val = implode(',', $field_val);
$asset->{$field->db_column} = $field_val;
Expand Down

0 comments on commit 1435865

Please sign in to comment.