FACT-Finder-Web-Components / magento2-module

FACT-Finder® Web Components for Magento 2
https://web-components.fact-finder.de/
Other
11 stars 17 forks source link

Undefined index: importType #386

Closed fritzmg closed 2 years ago

fritzmg commented 2 years ago

We currently get the following error when trying to export the product feed:

$ bin/magento factfinder:export
Generating FACT Finder export files

In ErrorHandler.php line 61:

Notice: Undefined index: importType in vendor/omikron/magento2-factfinder/src/Model/Api/PushImport.php on line 87

This error was introduced in https://github.com/FACT-Finder-Web-Components/magento2-module/commit/bda8b3a8c6f147670c0e7741f1c27f4b544d8b2e The changes in https://github.com/FACT-Finder-Web-Components/magento2-module/commit/bda8b3a8c6f147670c0e7741f1c27f4b544d8b2e assume, that the import response will always contain JSON data with the importType and statusMessages (see also the test). However, in our case the array returned by import is always empty. May be because we are on 7.3 and not NG?

fritzmg commented 2 years ago

I also notice that getPushImportResult will return a string that already contains <ul>...</ul>. However, Feed::execute will again wrap it in <ul>...</ul>, producing invalid HTML:

https://github.com/FACT-Finder-Web-Components/magento2-module/blob/1c77c5c461a403345079d36b607bb17758517ee9/src/Controller/Adminhtml/Export/Feed.php#L101-L102

paulfcdd commented 2 years ago

Hi @fritzmg, thank you for your report. Let me check this issue also on my environment and take a look at your PR and I'll back to you with more information

paulfcdd commented 2 years ago

Hi @fritzmg, after checking your report I have made a conclusion that the bug you reported also affect an information modal window which was add to give users more info about feed export/import statuses.

I have add new changes to cover this and for now there is no error while exporting on NG version and on 7.x version as well.

You also can check pull request for your version of plugin - https://github.com/FACT-Finder-Web-Components/magento2-module/pull/391

paulfcdd commented 2 years ago

Hi @fritzmg, regarding to my previous comment I'm also what to ask do you agree if I close Your pull-request and replace it with my one?

My PR solve the problem which You have reported and solve one more overlooked issue while exporting feed from Magento2 Admin panel

fritzmg commented 2 years ago

Yes, I closed my PR now.