[Rt-commit] rt branch, 4.0/ticket-clone-select-cf-fix, created. rt-4.0.8-350-g3f64e96

? sunnavy sunnavy at bestpractical.com
Wed Jan 16 13:00:05 EST 2013


The branch, 4.0/ticket-clone-select-cf-fix has been created
        at  3f64e96437a75f7271cd57230de6fb17bc8670da (commit)

- Log -----------------------------------------------------------------
commit 3f64e96437a75f7271cd57230de6fb17bc8670da
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jan 17 01:17:43 2013 +0800

    keep cf select values as an arrayref if there are multiple values in ticket clone
    
    otherwise those values won't be able to cloned correctly.
    
    btw the ticket clone code is used when creating a new link ticket on ticket
    display page.
    
    see also #20400

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index fcd34b1..c507e23 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -332,8 +332,14 @@ if ($CloneTicket) {
         while ( my $cf_value = $cf_values->Next ) {
             push @cf_values, $cf_value->Content;
         }
-        $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = join "\n",
-            @cf_values;
+
+        if ( @cf_values > 1 && $cf->Type eq 'Select' ) {
+            $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = \@cf_values;
+        }
+        else {
+            $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"} = join "\n",
+              @cf_values;
+        }
     }
 
     for ( keys %$clone ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list