I tried to add a export button in the product grid but when exporting the data i was confronted with the error below
1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): A joined field with this alias is already declared. Exception #0 (Magento\Framework\Exception\LocalizedException): A joined field with this alias is already declared. #1 Magento\Catalog\Ui\DataProvider\Product\ProductCollection\Interceptor->joinField() called at [vendor/magento/module-catalog-inventory/Ui/DataProvider/Product/AddQuantityFieldToCollection.php:27] #2 Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFieldToCollection->addField() called at [vendor/magento/module-catalog/Ui/DataProvider/Product/ProductDataProvider.php:108] #3 Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider->addField() called at [vendor/magento/module-ui/Component/Listing/Columns/Column.php:117] #4 Magento\Ui\Component\Listing\Columns\Column->addFieldToSelect() called at [vendor/magento/module-ui/Component/Listing/Columns/Column.php:70] #5 Magento\Ui\Component\Listing\Columns\Column->prepare() called at [vendor/magento/module-ui/Component/MassAction/Filter.php:189] #6 Magento\Ui\Component\MassAction\Filter->prepareComponent() called at [vendor/magento/module-ui/Component/MassAction/Filter.php:187] #7 Magento\Ui\Component\MassAction\Filter->prepareComponent() called at [vendor/magento/module-ui/Component/MassAction/Filter.php:187] #8 Magento\Ui\Component\MassAction\Filter->prepareComponent() called at [vendor/magento/module-ui/Component/MassAction/Filter.php:212] #9 Magento\Ui\Component\MassAction\Filter->getDataProvider() called at [vendor/magento/module-ui/Component/MassAction/Filter.php:130] #10 Magento\Ui\Component\MassAction\Filter->applySelectionOnTargetProvider() called at [vendor/magento/module-ui/Model/Export/ConvertToXml.php:134] #11 Magento\Ui\Model\Export\ConvertToXml->getXmlFile() called at [vendor/magento/module-ui/Controller/Adminhtml/Export/GridToXml.php:70] #12 Magento\Ui\Controller\Adminhtml\Export\GridToXml->execute() called at [generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml/Interceptor.php:24] #13 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108] #14 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:231] #15 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #16 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #17 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143] #18 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #19 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #20 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->___callPlugins() called at [generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToXml/Interceptor.php:39] #21 Magento\Ui\Controller\Adminhtml\Export\GridToXml\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:159] #22 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:99] #23 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #24 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #25 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #26 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26] #27 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:137] #28 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24] #29 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261] #30 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
the code I used was
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">
product_listing.product_listing.product_columns.ids
</item>
</item>
</argument>
</exportButton>