From a15cc8718ecdb8def249a167e5be14e95fdb282e Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 15 Mar 2021 15:56:36 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03626=20-=20Remove=20Attachment=20class?= =?UTF-8?q?=20from=20the=20"quick=20create"=20autocomplete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Base/Component/QuickCreate/QuickCreate.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php b/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php index 01c5d9976..ec5695f00 100644 --- a/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php +++ b/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php @@ -123,6 +123,7 @@ class QuickCreate extends UIBlock /** * Return the $aClasses array of DM classes minus the classes that should not be proposed in the autocomplete: + * - not derivating from cmdbAbstractObject * - n:n classes * * @param array $aClasses @@ -134,6 +135,11 @@ class QuickCreate extends UIBlock $aFilteredClasses = []; foreach ($aClasses as $sClassName => $sClassLabel){ + // Skip not derivating from cmdbAbstractObject + if(false === is_a($sClassName, '\cmdbAbstractObject', true)) { + continue; + } + // Skip n:n classes if(MetaModel::IsLinkClass($sClassName)) { continue;