Fix missing sub-categories when exporting main + sub categories, main categories in their own column

This commit is contained in:
Nathan Gray 2011-03-16 15:28:42 +00:00
parent 710c403d7c
commit 09226f0e17

View File

@ -282,6 +282,7 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
if($explode_settings['explode'] == self::MAIN_CATS && count(array_intersect($record->$field, array_keys($settings['subs'])))) {
// 3 part assign due to magic get method
$record_value = $record->$field_name;
if(!is_array($record_value)) $record_value = array($record_value);
foreach(array_intersect($record->$field, array_keys($settings['subs'])) as $sub_id) {
$record_value[] = $options['convert'] ? $settings['subs'][$sub_id] : $sub_id;
}