Skip to content

Commit

Permalink
Update FieldGroupCompleteness.php
Browse files Browse the repository at this point in the history
  • Loading branch information
devidw authored Apr 11, 2022
1 parent ff0e0c4 commit e75d8e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FieldGroup/FieldGroupCompleteness.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Devidw\ACF\FieldGroup\FieldGroup;
use Devidw\ACF\Field\Field;
use Devidw\ACF\Field\FieldVisibility;

/**
* Completeness class
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e75d8e5

Please sign in to comment.