Change our template attribute processing, to be collections, so we can find attributes using anycase keys

This commit is contained in:
2025-06-22 17:27:56 +10:00
parent ee3cb395c2
commit 3ad4c446ea
5 changed files with 66 additions and 34 deletions

View File

@@ -57,7 +57,7 @@ class HomeController extends Controller
$o->objectclass = [Entry::TAG_NOTAG=>$template->objectclasses->toArray()];
foreach ($o->getAvailableAttributes()
->filter(fn($item)=>$item->names_lc->intersect($template->attributes->map('strtolower'))->count())
->filter(fn($item)=>$item->names_lc->intersect($template->attributes->keys()->map('strtolower'))->count())
->sortBy(fn($item)=>Arr::get($template->order,$item->name)) as $ao)
{
$o->{$ao->name} = [Entry::TAG_NOTAG=>''];