Fix reading enum values from database table column data
authorMatthias Schmidt <gravatronics@live.com>
Fri, 27 Sep 2019 15:11:18 +0000 (17:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 27 Sep 2019 15:11:18 +0000 (17:11 +0200)
wcfsetup/install/files/lib/system/database/table/column/AbstractDatabaseTableColumn.class.php

index eb489c9b712b504364f15032df054af1cb524e97..379b661bad0a88b6a3bca024319a97988d6f7289 100644 (file)
@@ -173,8 +173,8 @@ abstract class AbstractDatabaseTableColumn implements IDatabaseTableColumn {
                        $column->decimals($data['decimals'] ?: null);
                }
                
-               if ($column instanceof IEnumDatabaseTableColumn) {
-                       $values = explode(',', $data['enumValues'] ?? []);
+               if ($column instanceof IEnumDatabaseTableColumn && !empty($data['enumValues'])) {
+                       $values = explode(',', $data['enumValues'] ?? '');
                        
                        $values = array_map(function($value) {
                                // trim one leading and one trailing `'`