From 32ecac3b1f854447ec8f1d71a80cbcbf252e3267 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 6 Oct 2019 07:03:34 +0200 Subject: [PATCH] Fix #2698 --- app/Services/Internal/Support/AccountServiceTrait.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index e5949853de..7f65f090a4 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -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]); } } }