fix export all fields
This commit is contained in:
@@ -131,6 +131,8 @@ class Export
|
||||
|
||||
$collection = null;
|
||||
|
||||
$exportAllFields = !array_key_exists('fieldList', $params);
|
||||
|
||||
if (array_key_exists('collection', $params)) {
|
||||
$collection = $params['collection'];
|
||||
} else {
|
||||
@@ -166,6 +168,10 @@ class Export
|
||||
$searchParams['select'] = explode(',', $searchParams['select']);
|
||||
}
|
||||
|
||||
if ($exportAllFields) {
|
||||
unset($searchParams['select']);
|
||||
}
|
||||
|
||||
$selectParams = $selectManager->getSelectParams($searchParams, true, true, true);
|
||||
}
|
||||
else {
|
||||
@@ -218,15 +224,12 @@ class Export
|
||||
}
|
||||
}
|
||||
|
||||
if (!array_key_exists('fieldList', $params)) {
|
||||
$exportAllFields = true;
|
||||
|
||||
if ($exportAllFields) {
|
||||
$fieldDefs = $this->metadata->get(['entityDefs', $this->entityType, 'fields'], []);
|
||||
$fieldList = array_keys($fieldDefs);
|
||||
|
||||
array_unshift($fieldList, 'id');
|
||||
} else {
|
||||
$exportAllFields = false;
|
||||
$fieldList = $params['fieldList'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user