diff --git a/core/cmdbsource.class.inc.php b/core/cmdbsource.class.inc.php index de7840923..285b42ed8 100644 --- a/core/cmdbsource.class.inc.php +++ b/core/cmdbsource.class.inc.php @@ -1268,6 +1268,7 @@ class CMDBSource return self::GetEnumOptions($sDataType, $sCompleteFieldType); }catch(CoreException $e){ //do nothing ; especially do not block setup. + IssueLog::Warning("enum was not parsed properly: $sCompleteFieldType. it should not happen during setup."); } } diff --git a/test/core/CMDBSourceTest.php b/test/core/CMDBSourceTest.php index ee87cf2c4..229db18b5 100644 --- a/test/core/CMDBSourceTest.php +++ b/test/core/CMDBSourceTest.php @@ -21,6 +21,7 @@ class CMDBSourceTest extends ItopTestCase { protected function setUp() { + parent::setUp(); require_once(APPROOT.'/core/cmdbsource.class.inc.php'); } @@ -112,6 +113,11 @@ class CMDBSourceTest extends ItopTestCase "ENUM('value 1 (with parenthesis)','value 2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci", "enum('value 1 (with parenthesis)','value 3') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci", ), + 'ENUM with different values, containing parenthesis' => array( + false, + "ENUM('value 1 ) with parenthesis)','value 2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci", + "enum('value 1 (with parenthesis)','value 3') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci", + ), ); } }