Subject: | two bugs discovered |
Hi. I discovered two bugs using Net::Redmine.
1. Please, don't convert description to utf8 in
Net::Redmine::Ticket->refresh (Encode::encode_utf8(...)), because it
converts even if my description is in ut8, and that breaks description's
encoding.
Suggestion:
-my $description = $wc->html2wiki( Encode::encode_utf8($p->find(".issue
.wiki")->html) );
+my $description = $wc->html2wiki( $p->find(".issue .wiki")->html );
2. When I change "status" of a ticket, the code should not save anything
but "status".
Net::Redmine::Ticket->save:
$mech->set_fields(
'issue[status_id]' => $self->status,
'issue[description]' => $self->description,
'issue[subject]' => $self->subject
);
Suggestion:
if ( $self->status )
{
$mech->set_field( 'issue[status_id]' => $self->status );
}
if ( $self->description )
{
$mech->set_field( 'issue[description]' => $self->description );
}
if ( $self->subject )
{
$mech->set_field( 'issue[subject]' => $self->subject );
}