From d43e837161c1c80b48749a72ab3fca7b2c0bd778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=A4rter?= Date: Tue, 30 Jan 2024 08:33:20 +0100 Subject: [PATCH] Issue #2889: Re-enact rel-10_1 behavior for checkbox ValueSet with undef value. --- Kernel/System/DynamicField/Driver/Checkbox.pm | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Kernel/System/DynamicField/Driver/Checkbox.pm b/Kernel/System/DynamicField/Driver/Checkbox.pm index 22b1d80fd6..0eb2dc7f06 100644 --- a/Kernel/System/DynamicField/Driver/Checkbox.pm +++ b/Kernel/System/DynamicField/Driver/Checkbox.pm @@ -184,12 +184,22 @@ sub ValueSet { } } - my $DBValue = $Self->ValueStructureToDB( - Value => $Param{Value}, - ValueKey => $Self->{ValueKey}, - Set => $Param{Set}, - MultiValue => $Param{DynamicFieldConfig}{Config}{MultiValue}, - ); + my $DBValue; + if ( !defined $Param{Value} ) { + $DBValue = [ + { + $Self->{ValueKey} => $Param{Value} + }, + ]; + } + else { + $DBValue = $Self->ValueStructureToDB( + Value => $Param{Value}, + ValueKey => $Self->{ValueKey}, + Set => $Param{Set}, + MultiValue => $Param{DynamicFieldConfig}{Config}{MultiValue}, + ); + } return $Kernel::OM->Get('Kernel::System::DynamicFieldValue')->ValueSet( FieldID => $Param{DynamicFieldConfig}->{ID},