From f67f3eaf740f7d4da74f63e374d0e89e13c8a5b1 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Mon, 27 Sep 2021 14:43:12 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B04326=20-=20Fix=20unknown=20attribute=20w?= =?UTF-8?q?hen=20no=20state=20attcode=20is=20given?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/metamodel.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 1a65af735..c70ee91d4 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -7726,6 +7726,10 @@ abstract class MetaModel */ public static function GetEnumStyle(string $sClass, string $sAttCode, string $sValue = ''): ?ormStyle { + if (empty($sAttCode)) { + return null; + } + $oAttDef = self::GetAttributeDef($sClass, $sAttCode); if (!$oAttDef instanceof AttributeEnum) { throw new CoreException("MetaModel::GetEnumStyle() Attribute $sAttCode of class $sClass is not an AttributeEnum\n");