Skip to content

Order CSV Export breaks in Magento 2.4.6 #133

@ioancatanoaiaosf

Description

@ioancatanoaiaosf

We recently upgraded to Magento 2.4.6 and we noticed that order CSV export in orders grid breaks when using a custom view saved before the upgrade:

1 exception(s):
Exception #0 (Exception): Warning: Undefined array key "visible" in /var/www/php/vendor/magento/module-sales/Model/ExportViewFilterProcessor.php on line 144

Exception #0 (Exception): Warning: Undefined array key "visible" in /var/www/php/vendor/magento/module-sales/Model/ExportViewFilterProcessor.php on line 144
<pre>#1 Magento\Sales\Model\ExportViewFilterProcessor->Magento\Sales\Model\{closure}()
#2 array_walk() called at [vendor/magento/module-sales/Model/ExportViewFilterProcessor.php:141]
#3 Magento\Sales\Model\ExportViewFilterProcessor->getActiveColumnsForGrid() called at [vendor/magento/module-sales/Model/ExportViewFilterProcessor.php:61]
#4 Magento\Sales\Model\ExportViewFilterProcessor->execute() called at [vendor/magento/module-sales/Plugin/Model/Export/OrderGridExportFilterColumn.php:74]
#5 Magento\Sales\Plugin\Model\Export\OrderGridExportFilterColumn->afterGetFields() called at [vendor/magento/framework/Interception/Interceptor.php:146]
#6 Magento\Ui\Model\Export\MetadataProvider\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 Magento\Ui\Model\Export\MetadataProvider\Interceptor->___callPlugins() called at [generated/code/Magento/Ui/Model/Export/MetadataProvider/Interceptor.php:32]
#8 Magento\Ui\Model\Export\MetadataProvider\Interceptor->getFields() called at [vendor/magento/module-ui/Model/Export/ConvertToCsv.php:76]
#9 Magento\Ui\Model\Export\ConvertToCsv->getCsvFile() called at [vendor/magento/module-ui/Controller/Adminhtml/Export/GridToCsv.php:70]
#10 Magento\Ui\Controller\Adminhtml\Export\GridToCsv->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#11 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#12 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins() called at [generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php:23]
#14 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#15 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]
#16 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#17 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#18 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]
#19 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#20 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#21 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins() called at [generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php:32]
#22 Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#23 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#24 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:146]
#25 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#26 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#27 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#28 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#29 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#30 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#31 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#32 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre>

After some investigation we found the problem relates with ui_bookmarks that contain the following column structure that no longer pass the new filter processor introduced by magento: \Magento\Sales\Model\ExportViewFilterProcessor.php

	"shipper_order_join": {
		"carrier_group": {
			"visible": true,
			"sorting": false
		},
		"time_slot": {
			"visible": true,
			"sorting": false
		},
		"pickup_location": {
			"visible": true,
			"sorting": false
		},
		"carrier_type": {
			"visible": true,
			"sorting": false
		},
		"delivery_date": {
			"visible": true,
			"sorting": false
		},
		"dispatch_date": {
			"visible": true,
			"sorting": false
		}

So far we identified to possible approaches:

  1. cleanup bookmarks directly in db
  2. delete or recreate the bookmarks

Are there any plans to fix in a future release?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions