[Rt-commit] rt branch, 4.0/rest-just-call-add-custom-field-value, created. rt-4.0.6-222-g3ccc4f3

Ruslan Zakirov ruz at bestpractical.com
Mon Jul 2 14:21:50 EDT 2012


The branch, 4.0/rest-just-call-add-custom-field-value has been created
        at  3ccc4f3d0516e40e9e6a118fdc743ee0969b5019 (commit)

- Log -----------------------------------------------------------------
commit 3ccc4f3d0516e40e9e6a118fdc743ee0969b5019
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Jul 2 21:05:36 2012 +0300

    just call AddCustomField value
    
    First of all calling Delete directly on OCFV is wrong,
    doesn't leave a trail and transaction is wrong - says that
    value was added, not replaced.
    
    We do report that "thing" was already the current value for
    other fields, so I don't see reason to handle it specially
    for custom fields.

diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default
index db00601..3ef9632 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -391,20 +391,9 @@ else {
                     }
                 }
                 elsif ( $cf->SingleValue ) {
-                    my $old = $vals->Next;
-                    if ( $old ) {
-                        if ( $val ne $old->Content ) {
-                            $old->Delete;
-                            ($n, $s) = $ticket->AddCustomFieldValue(
-                                 Field => $cf, Value => $val );
-                            $s =~ s/^# // if defined $s;
-                        }
-                    }
-                    else {
-                        ($n, $s) = $ticket->AddCustomFieldValue(
-                             Field => $cf, Value => $val );
-                        $s =~ s/^# // if defined $s;
-                    }
+                    ($n, $s) = $ticket->AddCustomFieldValue(
+                         Field => $cf, Value => $val );
+                    $s =~ s/^# // if defined $s;
                 }
                 else {
                     my @new;

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


More information about the Rt-commit mailing list