[Top][All Lists]

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

[Dolibarr-dev] Revert of commit

From: Laurent Destailleur (eldy)
Subject: [Dolibarr-dev] Revert of commit
Date: Tue, 11 Jun 2013 00:24:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6


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:

Eldy (Laurent Destailleur).

EMail: address@hidden

Dolibarr (Project leader):
To make a donation for Dolibarr project via Paypal: address@hidden
AWStats (Author) :
To make a donation for AWStats project via Paypal: address@hidden
AWBot (Author) :
CVSChangeLogBuilder (Author) :

reply via email to

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