dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Trigger refactor


From: [Kreiz IT] Cédric GROSS
Subject: Re: [Dolibarr-dev] Trigger refactor
Date: Thu, 3 Jul 2014 10:58:53 +0200

Hi Marcos,

 

I started to review all trigger.

As far as I see, all your bug report fall in 2 categories :

-          Wrong handling of error for bug display

-          Object doesn’t rollback action if trigger fail

 

My last commit in develop create a new method in commonobject class for trigger call.

You just have to call : $result=$this->call_trigger(tigger_name, $user);

And treat error.

This permit to avoid duplicate same 5 lines of code everywhere.

 

Cedric

 

De : address@hidden [mailto:address@hidden De la part de Marcos García
Envoyé : jeudi 3 juillet 2014 10:39
À : Posts about Dolibarr ERP & CRM development and coding
Objet : [Dolibarr-dev] Trigger refactor

 

Hi all:

 

I was thinking of refactoring things related to triggers. The first step I thought was moving all the common functions to an abstract class.

 

I've made a GIST so that you can take a look: https://gist.github.com/marcosgdf/2aacea869efe67c0d1cf

 

And so the triggers will extend from it resulting in: https://gist.github.com/marcosgdf/64464f14f32ce3667dad

 

This is the first step to improve triggers handling.

 

What do you think about it?

 

Regards,

 

Marcos García

address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]