Fix adding new attributes, show that blank values will delete the attribute

This commit is contained in:
Deon George 2024-01-09 23:35:06 +11:00
parent 1f753c4dc6
commit 3b6ee582dd
2 changed files with 3 additions and 2 deletions

View File

@ -138,7 +138,8 @@ class Entry extends Model
$o->required_by(collect($this->getAttribute('objectclass'))); $o->required_by(collect($this->getAttribute('objectclass')));
// Store our original value to know if this attribute has changed // Store our original value to know if this attribute has changed
$o->oldValues(Arr::get($this->original,$attribute)); if ($x=Arr::get($this->original,$attribute))
$o->oldValues($x);
$result->put($attribute,$o); $result->put($attribute,$o);
} }

View File

@ -90,7 +90,7 @@
@endif @endif
<td>{{ Arr::get(Arr::get($o->getOriginal(),$key),$xx,'['.strtoupper(__('New Value')).']') }}</td> <td>{{ Arr::get(Arr::get($o->getOriginal(),$key),$xx,'['.strtoupper(__('New Value')).']') }}</td>
<td>{{ $y=Arr::get($value,$xx) }}<input type="hidden" name="{{ $key }}[]" value="{{ $y }}"></td> <td>{{ ($y=Arr::get($value,$xx)) ?: '['.strtoupper(__('Deleted')).']' }}<input type="hidden" name="{{ $key }}[]" value="{{ $y }}"></td>
@endfor @endfor
</tr> </tr>
@endforeach @endforeach