Fix when cloning an attribute, ensure we blank out the previous value. When processing request submission '0' could be a valid value.

This commit is contained in:
Deon George 2025-01-17 18:09:25 +11:00
parent 5a922fe202
commit 77a139016b
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ class HomeController extends Controller
$o = config('server')->fetch($dn); $o = config('server')->fetch($dn);
foreach ($request->except(['_token','dn','userpassword_hash','userpassword']) as $key => $value) foreach ($request->except(['_token','dn','userpassword_hash','userpassword']) as $key => $value)
$o->{$key} = array_filter($value); $o->{$key} = array_filter($value,fn($item)=>! is_null($item));
// We need to process and encrypt the password // We need to process and encrypt the password
$passwords = []; $passwords = [];

View File

@ -13,7 +13,7 @@
// Create a new entry when Add Value clicked // Create a new entry when Add Value clicked
$('#{{ $o->name_lc }}.addable').click(function (item) { $('#{{ $o->name_lc }}.addable').click(function (item) {
var cln = $(this).parent().parent().find('input:last').clone(); var cln = $(this).parent().parent().find('input:last').clone();
cln.val('').attr('placeholder', '[@lang('NEW')]'); cln.attr('value','').attr('placeholder', '[@lang('NEW')]');
cln.appendTo('#' + item.currentTarget.id) cln.appendTo('#' + item.currentTarget.id)
}); });
}); });