$fieldConfig) { if (($fieldConfig['config']['type'] ?? '') !== 'json') { continue; } // Ensure that even for new records, the field is always an array - especially if a default value is defined if (is_string($result['databaseRow'][$fieldName])) { try { $result['databaseRow'][$fieldName] = json_decode($result['databaseRow'][$fieldName], true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException) { $result['databaseRow'][$fieldName] = []; } } } return $result; } }