Merge pull request #3869 from atm-alexis/3.9_FIX_hook_for_PDF

FIX all PDF hook must be in addreplace type
This commit is contained in:
Laurent Destailleur 2015-11-05 02:16:49 +01:00
commit bd96d2f5b1

View File

@ -169,7 +169,7 @@ class HookManager
)
)) $hooktype='addreplace';
// Deprecated hook types ('returnvalue')
if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
//if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
if ($method == 'insertExtraFields')
{
$hooktype='returnvalue'; // deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.