Skip to content

Firefly III: a personal finances manager

Fix #2698

James Cole32ecac3b1f85
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]);
}
}
}