From 894e57c9c7391e1207a6e440e1b27ffc2cd121b1 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 10 Mar 2025 12:33:37 +1100 Subject: [PATCH] Fix detection of new attributes added to an entry --- app/Ldap/Entry.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Ldap/Entry.php b/app/Ldap/Entry.php index b52a3617..da54cb17 100644 --- a/app/Ldap/Entry.php +++ b/app/Ldap/Entry.php @@ -94,12 +94,10 @@ class Entry extends Model $key = $this->normalizeAttributeKey($key); - if ((! $this->objects->get($key)) && $value) { - $this->objects->put($key,Factory::create($key,$value)); + if ((! $this->objects->get($key)) && $value) + $this->objects->put($key,Factory::create($key,[])); - } elseif ($this->objects->get($key)) { - $this->objects->get($key)->value = $this->attributes[$key]; - } + $this->objects->get($key)->value = $this->attributes[$key]; return $this; } @@ -164,7 +162,6 @@ class Entry extends Model /** * Convert all our attribute values into an array of Objects * - * @param array $attributes * @return Collection */ public function getAttributesAsObjects(): Collection