store good, update needs work

This commit is contained in:
spencerrlongg 2024-02-21 21:33:34 -06:00
parent d67ff54f4b
commit 20dbacd22f

View file

@ -585,6 +585,16 @@ class AssetsController extends Controller
}
}
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);
}
@ -665,6 +675,16 @@ class AssetsController extends Controller
}
}
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;