Skip to content

Commit b34dad8

Browse files
committed
Fix when adding a new objectclass with required attributes, validation errors are correctly display on the returned form
1 parent ef2ea5e commit b34dad8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/Http/Controllers/HomeController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,20 @@ public function frame(Request $request,?Collection $old=NULL): View
383383
: view('frames.'.$key['cmd']))
384384
->with('bases',$this->bases());
385385

386+
// If we are rendering a DN, rebuild our object
387+
$o = config('server')->fetch($key['dn']);
388+
foreach (collect(old())->except(['dn','_token']) as $attr => $value)
389+
$o->{$attr} = $value;
390+
386391
return match ($key['cmd']) {
387392
'create' => $view
388393
->with('container',old('container',$key['dn']))
389394
->with('step',1),
390395

391396
'dn' => $view
392397
->with('dn',$key['dn'])
393-
->with('page_actions',collect(['edit'=>TRUE,'copy'=>TRUE])),
398+
->with('o',$o)
399+
->with('page_actions',collect(['edit'=>TRUE])),
394400

395401
'import' => $view,
396402

resources/views/frames/dn.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@extends('layouts.dn')
22

33
@section('page_title')
4-
@include('fragment.dn.header',['o'=>($o=config('server')->fetch($dn))])
4+
@include('fragment.dn.header',['o'=>($o ?? $o=config('server')->fetch($dn))])
55
@endsection
66

77
@section('main-content')

0 commit comments

Comments
 (0)