|From:||[Kreiz IT] Cédric GROSS|
|Subject:||Re: [Dolibarr-dev] Trigger refactor|
|Date:||Thu, 3 Jul 2014 10:58:53 +0200|
I started to review all trigger.
As far as I see, all your bug report fall in 2 categories :
<![if !supportLists]>- <![endif]>Wrong handling of error for bug display
<![if !supportLists]>- <![endif]>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.
De : address@hidden [mailto:address@hidden De la part de Marcos García
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?
|[Prev in Thread]||Current Thread||[Next in Thread]|