From 61fb800f232f5e7006966746ece269897e394f85 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Mon, 9 Feb 2015 13:16:30 +0000 Subject: [PATCH] #1060 Internal: improved the symptoms when calling MetaModel::GetAttributeDef with an invalid attribute code (feedback on the class name and no more FATAL errors) -retrofit from trunk SVN:2.0.3[3494] --- core/metamodel.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 4f078aa4a..aede7e916 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -835,6 +835,10 @@ abstract class MetaModel final static public function GetAttributeDef($sClass, $sAttCode) { self::_check_subclass($sClass); + if (!isset(self::$m_aAttribDefs[$sClass][$sAttCode])) + { + throw new Exception("Unknown attribute $sAttCode from class $sClass"); + } return self::$m_aAttribDefs[$sClass][$sAttCode]; }