Fix validation when creating a new entry and not identifying required attributes, broken by 4a84c25

This commit is contained in:
Deon George 2025-03-18 23:39:19 +11:00
parent 1abc2cc6e1
commit 87bae89ea3

View File

@ -557,7 +557,7 @@ final class AttributeType extends Base {
->unique();
$validation = collect(Arr::get(config('ldap.validation'),$this->name_lc,[]));
if (($heirachy->intersect($this->required_by_object_classes)->count() > 0)
if (($heirachy->intersect($this->required_by_object_classes->keys())->count() > 0)
&& (! collect($validation->get($this->name_lc))->contains('required'))) {
$validation->put($this->name_lc,array_merge(['required','min:1'],$validation->get($this->name_lc,[])))
->put($this->name_lc.'.*',array_merge(['required','min:1'],$validation->get($this->name_lc.'.*',[])));