Fix multiselects go missing when importing

This commit is contained in:
nathangray 2017-08-04 09:20:26 -06:00
parent 02f0936f9c
commit a8e27f2fad

View File

@ -318,7 +318,7 @@ class importexport_export_csv implements importexport_iface_export_record
} }
foreach((array)$fields['select'] as $name) { foreach((array)$fields['select'] as $name) {
if($record->$name != null && is_array($selects) && $selects[$name]) { if($record->$name != null && is_array($selects) && $selects[$name]) {
$record->$name = explode(',', $record->$name); $record->$name = is_string($record->$name) ? explode(',', $record->$name) : $record->$name;
if(is_array($record->$name)) { if(is_array($record->$name)) {
$names = array(); $names = array();
foreach($record->$name as $_name) { foreach($record->$name as $_name) {