Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Actions/ExportJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,19 @@ protected function getDataSheetToRead(TaskInterface $task) : DataSheetInterface
// widget calling the action is a button and it normally does not know
// which columns to export.

// skip this step if we use the exportDataSheet as the reference (e.g. exporting from DataTables with a configurator)
$widget = $this->getWidgetToReadFor($task);
if ($widget && $this->getUseExportDataSheet($widget) === false) {
$dataSheet = $widget->prepareDataSheetToRead($dataSheet);
if ($widget !== null) {
$widgetSheet = $widget->prepareDataSheetToRead($dataSheet);
if($this->getUseExportDataSheet($widget) === false) {
$dataSheet = $widgetSheet;
} else {
// If we use the exportDataSheet as the reference (e.g. exporting from DataTables with a configurator)
// we need to transfer aggregations.
// TODO geb 2026-04-14: Is this the right place and do we need to import other properties as well?
foreach ($widgetSheet->getAggregations() as $aggregation) {
$dataSheet->getAggregations()->add($aggregation);
}
}
}

$dataSheet->removeRows();
Expand Down