rm validation stuff

This commit is contained in:
spencerrlongg 2024-03-05 11:58:00 -06:00
parent b6fa6cba22
commit ad0f873ece
2 changed files with 0 additions and 30 deletions

View file

@ -585,16 +585,6 @@ 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);
}
@ -670,24 +660,12 @@ class AssetsController extends Controller
$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(is_array($field_val)) {
$field_val = implode(',', $field_val);
$asset->{$field->db_column} = $field_val;

View file

@ -304,14 +304,6 @@ class ValidationServiceProvider extends ServiceProvider
$field = CustomField::where('db_column', $attribute)->first();
$options = $field->formatFieldValuesAsArray();
// temporarily decrypt for validation
// so, this is breaking patches, i don't really get why.
// is it not encrypted here on an update? need to do more testing. :(
if($field->field_encrypted) {
$value = Crypt::decrypt($value);
}
dump(is_array($value));
if(is_array($value)) {
$invalid = array_diff($value, $options);
if(count($invalid) > 0) {