platform
platform copied to clipboard
Empty export result when pagination is hidden in datagrid
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
- OroPlatform version: 4.2
- PHP version: 7.4
- Database (MySQL, PostgreSQL) version: MySql 8.0
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