This commit is contained in:
James Cole 2019-10-06 07:03:34 +02:00
parent fee0eb68d5
commit 32ecac3b1f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -93,7 +93,16 @@ trait AccountServiceTrait
// if the field is set but NULL, skip it.
// if the field is set but "", update it.
if (isset($data[$field]) && null !== $data[$field]) {
$factory->crud($account, $field, (string)($data[$field] ?? ''));
// convert boolean value:
if (is_bool($data[$field]) && false === $data[$field]) {
$data[$field] = 0;
}
if (is_bool($data[$field]) && true === $data[$field]) {
$data[$field] = 1;
}
$factory->crud($account, $field, (string)$data[$field]);
}
}
}