Skip to content

Commit

Permalink
Issue #2889: Re-enact rel-10_1 behavior for checkbox ValueSet with un…
Browse files Browse the repository at this point in the history
…def value.
  • Loading branch information
stefanhaerter committed Jan 30, 2024
1 parent 0d36c27 commit d43e837
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Kernel/System/DynamicField/Driver/Checkbox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit d43e837

Please sign in to comment.