From 47248bf0b705bc6d5fca11e86bb8c95314ca2ead Mon Sep 17 00:00:00 2001 From: vdumas Date: Wed, 24 Apr 2024 15:34:41 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B07474=20-=20Setup=20crash=20when=20a=20pr?= =?UTF-8?q?ofile=20is=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/userrights.class.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index 1dd824f99..023cdf1bd 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -385,6 +385,12 @@ abstract class User extends cmdbAbstractObject /** @var \DBObjectSet $oSet */ $oSet = $this->Get('profile_list'); if ($oSet->Count() == 0) { + if (ContextTag::Check(ContextTag::TAG_SETUP)) { + // During setup, if a profile is no more part of iTop, it will be deleted + // But if it is the only profile assigned to a user, we don't want this to stop the setup + SetupLog::Warning("The user with id: ".$this->GetKey()." is no more usable as its last profile was removed during setup"); + return; + } $this->m_aCheckIssues[] = Dict::S('Class:User/Error:AtLeastOneProfileIsNeeded'); }