Skip to content
Snippets Groups Projects
Commit 8555691c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #2680 from marcosgdf/bug-1897-hook

[ bug #1897 ] PHP Fatal error when editing Margin module settings with USER_UPDATE_SESSION trigger turned on
parents 349ce5c1 ad5dd8e7
Branches
Tags v2.0
No related merge requests found
...@@ -178,6 +178,7 @@ Dolibarr better: ...@@ -178,6 +178,7 @@ Dolibarr better:
- A lot of pages called liste.php were renamed into list.php - A lot of pages called liste.php were renamed into list.php
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the - If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
warehouse module and your Point Of Sale module if you use one. warehouse module and your Point Of Sale module if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook
***** ChangeLog for 3.6.3 compared to 3.6.2 ***** ***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service - Fix: ref_ext was not saved when recording a customer order from web service
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Copyright (C) 2008 Matteli * Copyright (C) 2008 Matteli
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -575,17 +575,13 @@ if (! defined('NOLOGIN')) ...@@ -575,17 +575,13 @@ if (! defined('NOLOGIN'))
} }
else else
{ {
if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
{ $hookmanager->initHooks(array('main'));
// TODO We should use a hook here, not a trigger.
// Call triggers $action = '';
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $reshook = $hookmanager->executeHooks('updateSession', array(), $user, $action);
$interface=new Interfaces($db); if ($reshook < 0) {
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($result < 0) {
$error++;
}
// End call triggers
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment