mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
store good, update needs work
This commit is contained in:
parent
d67ff54f4b
commit
20dbacd22f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue