Skip to content

Commit

Permalink
Issue #3792: Added log notice to statistics if undefined element is u…
Browse files Browse the repository at this point in the history
…sed.
  • Loading branch information
stefanhaerter authored and svenoe committed Sep 30, 2024
1 parent 0baa120 commit 8d2c996
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Kernel/System/Stats.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2866,8 +2866,17 @@ sub _GenerateDynamicStats {
# all elements which are shown with multiselectfields
if ( $Ref1->{Block} ne 'Time' ) {
my %SelectedValues;
SELECTEDVALUE:
for my $Ref2 ( @{ $Ref1->{SelectedValues} } ) {

if ( !defined $Ref1->{Values}{$Ref2} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'notice',
Message => "Attribute $Ref2 should be used as $Ref1->{Name} in statistic $Param{Title}, but is not present. Skipping it.",
);
next SELECTEDVALUE;
}

# Do not translate the values, please see bug#12384 for more information.
$SelectedValues{$Ref2} = $Ref1->{Values}{$Ref2};
}
Expand Down

0 comments on commit 8d2c996

Please sign in to comment.