Removes setting the encryption status on update (#5833)

When we are updating a custom field, we don’t want to change the „field_encrypted“-setting on it.
This commit is contained in:
Till Deeke
2018-07-13 13:04:30 +02:00
committed by snipe
parent b4542d4d42
commit 0fb9f42ba4
2 changed files with 7 additions and 2 deletions
@@ -59,7 +59,13 @@ class CustomFieldsController extends Controller
{
$this->authorize('update', CustomField::class);
$field = CustomField::findOrFail($id);
$data = $request->all();
/**
* Updated values for the field,
* without the "field_encrypted" flag, preventing the change of encryption status
* @var array
*/
$data = $request->except(['field_encrypted']);
$validator = Validator::make($data, $field->validationRules());
if ($validator->fails()) {