From 0b6123328d599959d2e0494f9e9d108a84df2736 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Nov 2020 13:12:38 +0100 Subject: [PATCH] Removed rule with +99% of false positives --- .github/workflows/exakat.yml | 2 +- .../interface_50_modAgenda_ActionsAuto.class.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/exakat.yml b/.github/workflows/exakat.yml index 861f6ccd4b0..1998683b852 100644 --- a/.github/workflows/exakat.yml +++ b/.github/workflows/exakat.yml @@ -13,5 +13,5 @@ jobs: - name: Exakat uses: docker://exakat/exakat-ga with: - ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/WrongNumberOfArguments,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/UselessParenthesis,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UseConstant' + ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/UselessParenthesis,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UseConstant' ignore_dirs: '/htdocs/includes,/htdocs/build,/htdocs/dev,/htdocs/doc,/htdocs/scripts,/htdocs/test' \ No newline at end of file diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index ff4d2892436..fd082884ce2 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -77,6 +77,11 @@ class InterfaceActionsAuto extends DolibarrTriggers { if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing + // Do not log events when trigger is for creating event (infinite loop) + if (preg_match('/^ACTION_/', $action)) { + return 0; + } + $key = 'MAIN_AGENDA_ACTIONAUTO_'.$action; //var_dump($action.' - '.$conf->global->$key);exit; @@ -84,10 +89,6 @@ class InterfaceActionsAuto extends DolibarrTriggers if (empty($conf->global->$key)) { return 0; } - // Do not log events when trigger is for creating event (infinite loop) - if (preg_match('/^ACTION_/', $action)) { - return 0; - } $langs->load("agenda");