From e75d8e5ef80db2c2975ed3a252f67b80095712bd Mon Sep 17 00:00:00 2001 From: David Wolf <68775926+devidw@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:56:23 +0200 Subject: [PATCH] Update FieldGroupCompleteness.php --- src/FieldGroup/FieldGroupCompleteness.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FieldGroup/FieldGroupCompleteness.php b/src/FieldGroup/FieldGroupCompleteness.php index 9c48f3f..66bb3b5 100644 --- a/src/FieldGroup/FieldGroupCompleteness.php +++ b/src/FieldGroup/FieldGroupCompleteness.php @@ -4,7 +4,6 @@ use Devidw\ACF\FieldGroup\FieldGroup; use Devidw\ACF\Field\Field; -use Devidw\ACF\Field\FieldVisibility; /** * Completeness class @@ -39,7 +38,8 @@ public static function getCompleteness() } $nonEmptyFields = array_filter($userValues, function ($value) { - return !empty($value); + // `false` is a return value of the ACF true/false field, so we have to handle it as a field with a value and not as a field without a value. + return $value !== '' && $value !== null; }); if (count($nonEmptyFields) === 0 || count($userValues) === 0) {