Fix PHP error if cf['type2'] is a single value, not array

This commit is contained in:
nathan 2022-04-27 11:55:03 -06:00
parent b5f66c6cd8
commit fd53dfe82b

View File

@ -415,7 +415,7 @@ class Customfields implements \IteratorAggregate
self::$db->$op(self::TABLE, array(
'cf_label' => $cf['label'],
'cf_type' => $cf['type'],
'cf_type2' => $cf['type2'] ? implode(',', $cf['type2']) : null,
'cf_type2' => $cf['type2'] ? (is_array($cf['type2']) ? implode(',', $cf['type2']) : $cf['type2']) : null,
'cf_help' => $cf['help'],
'cf_values' => $cf['values'] ? json_encode($cf['values']) : null,
'cf_len' => (string)$cf['len'] !== '' ? $cf['len'] : null,