[rt-users] EditCustomFieldsOnUpdate does not work anymore

Jason A. Diegmueller doogles at doogles.com
Wed Jul 26 08:08:14 EDT 2006


JP, Todd, rt-users--

If modified exactly as listed below, this works completely along with 
proper notifications from RT.

I dropped the @Actions piece in the Callback (and perhaps over-improvised 
by also removing it from Display.html) based on the comment that you made 
(JP) that it was unnecessary.  Re-adding it and doing it exactly as you 
below works fine on my RT3.6.HEAD+Display.html-modification setup.

Sorry for the confusion, I over-improvised.

-jd

On Wed, 26 Jul 2006, Koopmann, Jan-Peter wrote:

> 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