[rt-users] Re-Display Ticket with added warning if owner changed during responding

Jim Brandt jbrandt at bestpractical.com
Mon Jun 27 15:31:55 EDT 2016


On 6/27/16 1:38 PM, Jim Brandt wrote:
>> Hey and thank you for your answer,
>>
>> I am using RT 4.4
>>
>>
>> <%init>
>> warn 'set checks_failure => 1';
>> $checks_failure = 1;
>> </%init>
>> <%args>
>> $checks_failure => undef
>> </%args>
>>
>> I expected every update to fail, but when I add a reply the ticket is
>> updated with "correspondence added".
>>
>> I noticed that outside of the Callback component $checks_failure value
>> is 0. And that seems to be the cause while changing checks_failure
>> inside of the callback doesnt have an effect. Is there a reason why
>> $checks_failure isnt passed by reference?
>>
>> I dont want to add code to Ticket/Update.html because I want to make a
>> maintainable extension that isnt lost in case of an RT upgrade.
>
> Hmm, yeah, that's strange. Everything else is passed by reference, we
> may need to look into changing that.
>
> In the meantime, you could update just that line to pass $checks_failure
> by reference to limit your changes to Update.html. Alternatively, you
> could add another line that duplicates the existing callback but passes
> checks_failure by reference. Then give it your own name for
> CallbackName. That might make it easier to pull forward when upgrading.

Looking closer, I believe $skip_update was added just for this purpose 
since it also can stop the update and is passed by reference. I think 
setting $skip_update to 1 when you want to trigger the message should do 
the trick.



More information about the rt-users mailing list