dolibarr-dev
[Top][All Lists]
Advanced

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

Re: [Dolibarr-dev] Revert of commit


From: Destailleur Laurent
Subject: Re: [Dolibarr-dev] Revert of commit
Date: Tue, 11 Jun 2013 10:44:08 +0200

You're right.

Note that I planned a second cleaning operation of code on hooks for 3.5 or 3.6. Goal is to remove all "TODO" found into class hookmanager.class.php.
Code is ready with 3.4, but with 3.5 or 3.6, I will comment code that have "TODO" before. After that we should have one method for hooks that works for all kind of hooks (hooks that output html on screen, hooks that return a value, hooks that replace action code).


2013/6/11 Régis Houssin <address@hidden>
Laurent,

so he must be the "revert" on Develop branch no?


Le 11/06/13 00:24, Laurent Destailleur (eldy) a écrit :
Regis,

I revert the commit you did about change into hook management to use resPrint to return value.

There is no need for this. Hooks for pdf_xxx are already hooks of type "returnvalue". This means, if you want your hook to return a specific value to replace data return, you must return your value into your hook with return $myvalue.
resPrint is a property to use to print something into output, that is different than a function returning a value.

Goal is to start to clean and uniformize way of working of triggers. There was at least 6 ways of working, with 3.4, we should keep only 2 types "returnvalue" and "addreplace".

With a future version, only "addreplace" type will be kept:  return code will be 1 or 0 (replace standard code or not) and to return data, hook will set ->result property and to ouput data to screen will set ->resprint.

This means this will break compatibility with old modules, but it is better to have modules to change to match good practices after a dolibarr upgrade to a new version than keeping bad code into dolibarr to match bad practices. More information on how trigger will works: http://wiki.dolibarr.org/index.php/Hooks_system

-- 
Eldy (Laurent Destailleur).

EMail: address@hidden
Web: http://www.destailleur.fr

Dolibarr (Project leader): http://www.dolibarr.org
To make a donation for Dolibarr project via Paypal: address@hidden
AWStats (Author) : http://awstats.sourceforge.net
To make a donation for AWStats project via Paypal: address@hidden
AWBot (Author) : http://awbot.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net

Cordialement,
-- 
Régis Houssin
---------------------------------------------------------
Cap-Networks
5, rue Corneille
01000 BOURG EN BRESSE
FRANCE
VoIP: +33 1 83 62 40 03
GSM: +33 6 33 02 07 97
Web: http://www.cap-networks.com/
Email: address@hidden

Speedealing Developer
SaaS offers: http://www.inodbox.com/
Development platform: https://speedealing.atlassian.net/
---------------------------------------------------------


reply via email to

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