LSformElement::jsonCompositeAttribute: fix checking non-multiple components value

This commit is contained in:
Benjamin Renard 2023-05-24 13:15:14 +02:00
parent 27ad049ac7
commit 341f555e0c
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -398,7 +398,12 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
// Apply check data rules
LSsession :: loadLSclass('LSformRule', null, true);
foreach($this -> getComponentConfig($c, 'check_data', array(), 'array') as $ruleType => $rconf) {
$errors = LSformRule :: validate_values($ruleType, $value, $rconf, $this);
$errors = LSformRule :: validate_values(
$ruleType,
$this -> getComponentConfig($c, 'multiple', false, 'bool')?$value:array($value),
$rconf,
$this
);
if (is_array($errors)) {
$retval = false;
foreach ($errors as $error) {