From d6b6cacbe5d38d96abe19047b3ab552045584c17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 20:02:12 +0100 Subject: [PATCH] Removed warning --- .travis.yml | 1 + htdocs/core/modules/DolibarrModules.class.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index afc792b7d3e..3f40145fc8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -133,6 +133,7 @@ install: php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi + # phpunit 9 is required for php 8 if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 69fce65f781..794cfd0cef4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1679,13 +1679,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $r_id = $this->rights[$key][0]; $r_desc = $this->rights[$key][1]; $r_type = isset($this->rights[$key][2]) ? $this->rights[$key][2] : ''; - $r_def = $this->rights[$key][3]; + $r_def = empty($this->rights[$key][3]) ? 0 : $this->rights[$key][3]; $r_perms = $this->rights[$key][4]; $r_subperms = isset($this->rights[$key][5]) ? $this->rights[$key][5] : ''; $r_modul = empty($this->rights_class) ?strtolower($this->name) : $this->rights_class; if (empty($r_type)) { $r_type = 'w'; } - if (empty($r_def)) { $r_def = 0; } // Search if perm already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def";