-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportExport - Sample Files in own Modules #6553
Comments
Thank you for reporting. |
Hi BaDos, |
I'm also after this functionality, any news? |
This issue was moved to magento-engcom/import-export-improvements#53 |
@EliasKotlyar Have you import categories via csv. I have created same but getting some issue. |
Preconditions
Happens in all Magento2 Versions.
Steps to reproduce
Try to provide your own Sample file in
/Files/Sample/<yourentity.csv>
Expected result
You can add your own sample-file to your module and it will be taken from the ImportExport Wizard in the Backend
Actual result
The sample file needs to be placed in the Module "ImportExport".
Why it happens?
This happens because of this code:
vendor/magento/module-import-export/Controller/Adminhtml/Import/Download.php
` /**
* Download sample file action
*
* @return \Magento\Framework\Controller\Result\Raw
*/
public function execute()
{
$fileName = $this->getRequest()->getParam('filename') . '.csv';
$moduleDir = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, self::SAMPLE_FILES_MODULE);
$fileAbsolutePath = $moduleDir . '/Files/Sample/' . $fileName;
$directoryRead = $this->readFactory->create($moduleDir);
$filePath = $directoryRead->getRelativePath($fileAbsolutePath);
This Code is taking sample Files only from the ImportExport-Module. There is no way to provide your own sample File.
Greetings
Elias
The text was updated successfully, but these errors were encountered: