Fix For Keyword Select / Create Ticket UI Bug in 2.0.8

Jesse,

When a new ticket is created in 2.0.8, and a single keyword select is
chosen, that value is not added to the database, and the ticket is
created with no keywords. Multiple keywords work as advertised.

Below is a fix I applied to Ticket.pm, and it seemed to fix the problem.

(note, this is not a patch, just a plain diff – do you want patches?)

–kip

*** Ticket.pm Fri Sep 21 16:45:34 2001
— Ticket.ks.pm Mon Oct 8 16:46:32 2001
*** 345,351 ****
next unless ($key =~ /^KeywordSelect-(.*)$/);

    my $ks = $1;

! my @keywords = @{$args{$key}};

    foreach my $keyword (@keywords) {
        my ($kval, $kmsg) = $self->_AddKeyword(KeywordSelect => $ks,

— 345,360 ----
next unless ($key =~ /^KeywordSelect-(.*)$/);

    my $ks = $1;

!
! my @keywords;
! my $kr = ref $args{$key};
! if ($kr =~ /ARRAY/) {
! @keywords = @{$args{$key}};
! }
! else {
! my $ky = $args{$key};
! @keywords = ($ky);
! }

    foreach my $keyword (@keywords) {
        my ($kval, $kmsg) = $self->_AddKeyword(KeywordSelect => $ks,

I posted a fix for this to rt-users on friday. If you’re on rt-devel, you
really should be on rt-users as wellOn Mon, Oct 08, 2001 at 04:54:57PM -0400, Kip Cranford wrote:

Jesse,

When a new ticket is created in 2.0.8, and a single keyword select is
chosen, that value is not added to the database, and the ticket is
created with no keywords. Multiple keywords work as advertised.

Below is a fix I applied to Ticket.pm, and it seemed to fix the problem.

(note, this is not a patch, just a plain diff – do you want patches?)

–kip

*** Ticket.pm Fri Sep 21 16:45:34 2001
— Ticket.ks.pm Mon Oct 8 16:46:32 2001


*** 345,351 ****
next unless ($key =~ /^KeywordSelect-(.*)$/);

    my $ks = $1;

! my @keywords = @{$args{$key}};

    foreach my $keyword (@keywords) {
        my ($kval, $kmsg) = $self->_AddKeyword(KeywordSelect => $ks,

— 345,360 ----
next unless ($key =~ /^KeywordSelect-(.*)$/);

    my $ks = $1;

!
! my @keywords;
! my $kr = ref $args{$key};
! if ($kr =~ /ARRAY/) {
! @keywords = @{$args{$key}};
! }
! else {
! my $ky = $args{$key};
! @keywords = ($ky);
! }

    foreach my $keyword (@keywords) {
        my ($kval, $kmsg) = $self->_AddKeyword(KeywordSelect => $ks,

rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.