Mailing List Archive

Scrip using TransactionBatch is run twice
I just discovered on RT 4.0.13 and 4.2.4 (not tested on latest one) that
creating a scrip with:

condition: "AnyTransaction"
custom prepare code: "return 1;"
custom commit code : RT->Logger->debug("test scrip"); return 1;
stage: Batch

then doing an update on the ticket using /Ticket/Update.html with a
corespondence and a cf change, the scrip action commit code is run twice!

do I misunderstand something or is this really a bug?



--
Easter-eggs Spécialiste GNU/Linux
44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com
Re: Scrip using TransactionBatch is run twice [ In reply to ]
On 09/10/15 06:57 AM, Emmanuel Lacour wrote:
> I just discovered on RT 4.0.13 and 4.2.4 (not tested on latest one) that
> creating a scrip with:
>
> condition: "AnyTransaction"
> custom prepare code: "return 1;"
> custom commit code : RT->Logger->debug("test scrip"); return 1;
> stage: Batch
>
> then doing an update on the ticket using /Ticket/Update.html with a
> corespondence and a cf change, the scrip action commit code is run twice!
>
> do I misunderstand something or is this really a bug?
>
Check the ticket history: that update is two transactions: Adding a
comment and changing a CF.
Transaction is from the back end's point of view, not the users.

Jeff
Re: Scrip using TransactionBatch is run twice [ In reply to ]
Le 09/10/2015 13:27, Jeff Voskamp a écrit :
>
>>
> Check the ticket history: that update is two transactions: Adding a
> comment and changing a CF.
> Transaction is from the back end's point of view, not the users.
>

that's why I'm using TransactionBatch ...


--
Easter-eggs Spécialiste GNU/Linux
44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com
Re: Scrip using TransactionBatch is run twice [ In reply to ]
Le 09/10/2015 13:54, Emmanuel Lacour a écrit :
> Le 09/10/2015 13:27, Jeff Voskamp a écrit :
>>
>>>
>> Check the ticket history: that update is two transactions: Adding a
>> comment and changing a CF.
>> Transaction is from the back end's point of view, not the users.
>>
>
> that's why I'm using TransactionBatch ...
>
>


got it and here is the fix :)

https://issues.bestpractical.com/Ticket/Display.html?id=31269

--
Easter-eggs Spécialiste GNU/Linux
44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com