Skip Menu |

This queue is for tickets about the RT-Action-NotifyGroup CPAN distribution.

Report information
The Basics
Id: 69449
Status: rejected
Priority: 0/
Queue: RT-Action-NotifyGroup

People
Owner: Nobody in particular
Requestors: gerard [...] eve-team.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Is the call to __ConvertOldArg() really useful ?
Date: Wed, 13 Jul 2011 19:06:32 +0200
To: bug-RT-Action-NotifyGroup [...] rt.cpan.org
From: Gerard FENELON <gerard [...] eve-team.com>
Hi I was looking at http://cpansearch.perl.org/src/RUZ/RT-Action-NotifyGroup-0.02/lib/RT/Action/NotifyGroup.pm and I was surprised by a part of the code. I must start by saying that I am not a Perl expert at all, I probably wrote 10000 times less lines of Perl as any of you. But this code really foxes me and I prefer to mention in case there is a real bug. sub SetRecipients { my $self = shift; my $arg = $self->Argument; my $old_arg = eval { Storable::thaw( $arg ) }; unless( $@ ) { $arg = $self->__ConvertOldArg( $old_arg ); return; } [...] First, return has no value whereas lower down in the same function I see "return 1"; I suspect that it is OK, Perl will probably do the "Right Thing" But maybe that call to return is wrong and you wanted to use $arg in the code ? Secondly $arg is not used so the line $arg = $self->__ConvertOldArg( $old_arg ); does not do anything unless __ConvertOldArg() does. So I looked at sub __ConvertOldArg { my $self = shift; my $arg = shift; my @res; foreach my $r ( @{ $arg } ) { my $obj; next unless $r->{'Type'}; if( lc $r->{'Type'} eq 'user' ) { $obj = RT::User->new( $RT::SystemUser ); } elsif ( lc $r->{'Type'} eq 'user' ) { $obj = RT::Group->new( $RT::SystemUser ); } else { next; } $obj->Load( $r->{'Instance'} ); my $id = $obj->id; next unless( $id ); push @res, $id; } return join ';', @res; } It seems to me that this function just build the @res array. I do not see anywhere where there could be side-effects or modifications of the state of some objects. I hope that I have covered myself with ridicule. Regards Gerard
Subject: Re: [rt.cpan.org #69449] Is the call to __ConvertOldArg() really useful ?
Date: Thu, 14 Jul 2011 00:49:45 +0400
To: bug-RT-Action-NotifyGroup [...] rt.cpan.org
From: Ruslan Zakirov <ruz [...] bestpractical.com>
On Wed, Jul 13, 2011 at 9:06 PM, Gerard FENELON via RT <bug-RT-Action-NotifyGroup@rt.cpan.org> wrote: Show quoted text
> I was looking at > http://cpansearch.perl.org/src/RUZ/RT-Action-NotifyGroup-0.02/lib/RT/Action/NotifyGroup.pm > and I was surprised by a part of the code. > I must start by saying that I am not a Perl expert at all, > I probably wrote 10000 times less lines of Perl as any of you. > But this code really foxes me and I prefer to mention in case there is a > real bug.
Hi, May be you're right. I even not going to look at it. This extension is now part of RT 3.8 core. Code has been reviewed during merge. Code that should upgrade Argument from old (used in 0.01) format to new has been dropped as useless. During review I noticed that it's buggy and it was another reason to drop this part. -- Best regards, Ruslan.
Subject: Re: [rt.cpan.org #69449] Is the call to __ConvertOldArg() really useful ?
Date: Mon, 18 Jul 2011 15:01:59 +0200
To: bug-RT-Action-NotifyGroup [...] rt.cpan.org
From: Gerard FENELON <gerard [...] eve-team.com>
No problem. I was just passing by and thought that I would mention it. Thanks Gerard On 2011-07-13 22:50, Ruslan Zakirov via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69449> > > On Wed, Jul 13, 2011 at 9:06 PM, Gerard FENELON via RT > <bug-RT-Action-NotifyGroup@rt.cpan.org> wrote:
>> I was looking at >> http://cpansearch.perl.org/src/RUZ/RT-Action-NotifyGroup-0.02/lib/RT/Action/NotifyGroup.pm >> and I was surprised by a part of the code. >> I must start by saying that I am not a Perl expert at all, >> I probably wrote 10000 times less lines of Perl as any of you. >> But this code really foxes me and I prefer to mention in case there is a >> real bug.
> Hi, > > May be you're right. I even not going to look at it. This extension is > now part of RT 3.8 core. Code > has been reviewed during merge. Code that should upgrade Argument from > old (used in 0.01) format > to new has been dropped as useless. During review I noticed that it's > buggy and it was another reason > to drop this part.