From 5a397fff722bde463c1a8f29b4b1eff3e00d2da2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Mar 2018 00:16:32 +0100 Subject: [PATCH] Fix scrutinizer bugs --- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/core/modules/modSyslog.class.php | 2 +- htdocs/societe/paymentmodes.php | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index b019dd7068c..ba39a14d243 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -505,7 +505,7 @@ class Account extends CommonObject * @param int $notrigger 1=Disable triggers * @return int < 0 if KO, > 0 if OK */ - function create(User $user = null, $notrigger=0) + function create(User $user, $notrigger=0) { global $langs,$conf, $hookmanager; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 38883ce2826..517cc9894f9 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -263,7 +263,7 @@ class DolibarrModules // Can not be abstract, because we need to insta public $always_enabled; /** - * @var bool Module is enabled globally (Multicompany support) + * @var int Module is enabled globally (Multicompany support) */ public $core_enabled; diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index b3e83f90ca2..39a4c93951b 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -52,7 +52,7 @@ class modSyslog extends DolibarrModules // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Activate debug logs (syslog)"; // Can be enabled / disabled only in the main company - $this->core_enabled = true; + $this->core_enabled = 1; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 1683168e755..83ba4c7a899 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -624,8 +624,9 @@ if (empty($reshook)) $card=$cu->sources->retrieve("$source"); if ($card) { - $card->delete(); // $card->detach(); Does not work with card_, only with src_ + if (method_exists($card, 'detach')) $card->detach(); + else $card->delete(); } $url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;