oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

Empty export result when pagination is hidden in datagrid #1071

Open hvanoch opened 2 years ago

hvanoch commented 2 years ago

Summary
When exporting a datagrid, if the option hide: true is set, the export is empty for csv type. (an error is raised when using XLSX)

Steps to reproduce
Create a datagrid with options:

datagrids:
    [name]:
        options:
            toolbarOptions:
                pagination:
                    hide: true
            export: true

Export the grid in csv format

Actual Result empty csv file

Expected Result
records exported

Details about your environment

The reason why the file is empty is because $this->totalCount = $gridData->getTotalRecords(); returns 0 in src/Oro/Bundle/DataGridBundle/ImportExport/DatagridExportConnector.php method ensureSourceDataInitialized