Skip to content

Commit

Permalink
Tidying: ObjectParamAdd() always returns an empty list.
Browse files Browse the repository at this point in the history
So assigning the result of ObjectParamAdd() is not useful.
  • Loading branch information
bschmalhofer committed Feb 2, 2024
1 parent 8b834c0 commit 43bdbec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Kernel/Modules/AgentTicketBounce.pm
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ sub Run {
}

# get template generator object
my $TemplateGenerator = $Kernel::OM->ObjectParamAdd(
$Kernel::OM->ObjectParamAdd(
'Kernel::System::TemplateGenerator' => { %{$Self} }
);
$TemplateGenerator = $Kernel::OM->Get('Kernel::System::TemplateGenerator');
my $TemplateGenerator = $Kernel::OM->Get('Kernel::System::TemplateGenerator');

# prepare salutation
$Param{Salutation} = $TemplateGenerator->Salutation(
Expand Down
7 changes: 3 additions & 4 deletions Kernel/Modules/AgentTicketBulk.pm
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,13 @@ sub Run {
my $Customer = $Recipients[0];

# get template generator object
my $CustomerUserObject = $Kernel::OM->Get('Kernel::System::CustomerUser');
my $TemplateGeneratorObject = $Kernel::OM->ObjectParamAdd(
my $CustomerUserObject = $Kernel::OM->Get('Kernel::System::CustomerUser');
$Kernel::OM->ObjectParamAdd(
'Kernel::System::TemplateGenerator' => {
CustomerUserObject => $CustomerUserObject,
},
);

$TemplateGeneratorObject = $Kernel::OM->Get('Kernel::System::TemplateGenerator');
my $TemplateGeneratorObject = $Kernel::OM->Get('Kernel::System::TemplateGenerator');

# generate sender name
my $From = $TemplateGeneratorObject->Sender(
Expand Down
10 changes: 6 additions & 4 deletions Kernel/System/ObjectManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ sub ObjectInstanceRegister {

=head2 ObjectParamAdd()
Adds arguments that will be passed to constructors of classes
when they are created, in the same format as the C<L<new()>> method
receives them. Existing constructor arguments are overwritten. Already
existing constructor arguments are kept.
Merge the arguments that will be passed to constructors of classes
when they are created. The format in the same as for the C<L<new()>> method
of the objects. Existing constructor arguments are overwritten. Already
existing constructor arguments, that are not in the new list, are kept.
$Kernel::OM->ObjectParamAdd(
'Kernel::System::Ticket' => {
Expand All @@ -407,6 +407,8 @@ existing constructor arguments are kept.
},
);
Always returns an empty list.
=cut

sub ObjectParamAdd {
Expand Down

0 comments on commit 43bdbec

Please sign in to comment.