[rt-users] EditCustomFieldsOnUpdate does not work anymore

Koopmann, Jan-Peter Jan-Peter.Koopmann at seceidos.de
Wed Jul 26 07:37:21 EDT 2006


On Wednesday, July 26, 2006 1:02 PM Jason A. Diegmueller wrote:

> Perhaps this is an unintended side effect (or perhaps it's by
> design), but the only problem I've found with this approach is that
> Custom Field changes don't get mentioned at the top.  I get "Message
> recorded" or "Status changed to xxx", but I don't see the CF changes
> even though they are made.    

That is strange. With 3.6.0 and after these changes this works for us for the first time. All changes on the update page seem to be recorded at the top of the resulting Display.html and all changes show in the following section. Let's compare one more time. My setup currently:

BeforeDisplay:
<%init>
my $ARGSRef = $ARGS{'ARGSRef'};
if ($$ARGSRef{'id'} ne 'new'){
        my $Ticket = LoadTicket($$ARGSRef{'id'});
        my @cf_results = ProcessObjectCustomFieldUpdates(ARGSRef => $ARGSRef);
        my @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => $ARGSRef);

        delete $cf_results[0] if ((scalar(@cf_results) == 1) && ($cf_results[0] eq ''));
        push @{$ARGS{Actions}}, @cf_results, @dresults;
}
</%init>

<%args>
$Actions => []
</%args>


BeforeMessageBox:
<%init>
my $Ticket = LoadTicket($ARGS{'id'});
</%init>
<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &>
<& /Ticket/Elements/EditDueDate, TicketObj => $ Ticket &>
<& /Ticket/Elements/EditPriority, TicketObj => $ Ticket &>


Bottom of Display.html (the part that Jesse should change):

# This code does automatic redirection if any updates happen.
# It doesn't work for the client.


$m->comp('/Elements/Callback', _CallbackName => 'BeforeDisplay',
         TicketObj => \$TicketObj, Tickets => \$Tickets, ARGSRef => \%ARGS, Actions => \@Actions );

if (@Actions) {
    # We've done something, so we need to clear the decks to avoid
    # resubmission on refresh.
    # But we need to store Actions somewhere too, so we don't lose them.
    $session{"Actions"} = \@Actions;
    $m->redirect($RT::WebURL."Ticket/Display.html?id=".$TicketObj->id);
} else {
    @Actions = @{$session{"Actions"} || [] };
    delete $session{"Actions"};
}

Please note that in addition to CustomFields we also let the user change priority and due dates on the update page. Works like a charm.

Jason, can you confirm that you are running a similar setup with 3.6.x?



Kind regards,
  JP



More information about the rt-users mailing list