Skip to content

Commit

Permalink
Merge pull request #361 from JohnVillalovos/jlvillal/notset_okay
Browse files Browse the repository at this point in the history
fix: if an attribute is not required, allow it to not be set
  • Loading branch information
effgarces authored Jun 1, 2024
2 parents 4a0c1d1 + a08db74 commit c0c4324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Application/Attributes/AttributeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ public function Validate($category, $attributeValues, $entityIds = [], $ignoreEm
continue;
}

if (!$attribute->Required() && !array_key_exists($attribute->Id(), $values)) {
continue;
}

$value = trim($values[$attribute->Id()]);
$label = $attribute->Label();

Expand Down

0 comments on commit c0c4324

Please sign in to comment.