Merge branch 'issue628' into 111_exports_suite

This commit is contained in:
Mathieu Jaumotte 2022-09-22 13:49:00 +02:00
commit 4631f04da6

View File

@ -496,9 +496,14 @@ class SpreadSheetFormatter implements FormatterInterface
// 3. iterate on `keysExportElementAssociation` to store the callable
// in cache
foreach ($keysExportElementAssociation as $key => [$element, $data]) {
// handle the case when there is not results lines (query is empty)
if ([] === $allValues) {
$this->cacheDisplayableResult[$key] = $element->getLabels($key, ['_header'], $data);
} else {
$this->cacheDisplayableResult[$key] =
$element->getLabels($key, array_unique($allValues[$key]), $data);
}
}
// the cache is initialized !
$this->cacheDisplayableResultIsInitialized = true;