英文:
Import fails with "The import/export profile with id x can only be used for import"
问题
我们使用的是Shopware 6.5.2.1中标记为“import”的配置文件进行产品导入。
但我们收到以下消息:
具有id x的导入/导出配置文件只能用于导入
在导入被挂起处理的同时。我们有一个错误(文件中的重复产品编号),但在配置文件仅设置为“import”时,错误报告并不正确。
这是否是正常行为还是一个错误?
我们猜测Shopware在内部也尝试导出数据,以用于错误报告?
备注:问题不是关于导入文件中提到的错误 - 我们知道我们可以通过将匹配列设置为“productNumber”而不是“id”来解决“重复产品编号”的问题。
英文:
We did a product Import with a profile which is only marked as "import" in Shopware 6.5.2.1
Still we get the message
The import/export profile with id x can only be used for import
In the message consumer while the import is stuck on processing.
We have an error (duplicate productNumber in the file) - but this is not properly reported in the case the profile is set only to "import".
Is this normal behavior or a bug?
We assume that Shopware internally tries to also export the data, to use it for the error report?
Remark: The question is not about the above mentioned error in the import file - we know we can fix the "duplicate product number" problem by setting the matching column to productNumber
instead of id
.
答案1
得分: 1
We assume that Shopware internally tries to also export the data, to use it for the error report?
是的,就是这样。 我认为这可以被视为一个错误,请您报告一下吗?
If it's urgent you can patch it for the time being:
如果很紧急,您可以暂时修复它:
diff --git a/src/Core/Content/ImportExport/Service/ImportExportService.php b/src/Core/Content/ImportExport/Service/ImportExportService.php
--- a/src/Core/Content/ImportExport/Service/ImportExportService.php (revision d832807a8e3a4e7e4cfc922e18fdf7bb8d386ac9)
+++ b/src/Core/Content/ImportExport/Service/ImportExportService.php (date 1687804790920)
@@ -51,7 +51,10 @@
): ImportExportLogEntity {
$profileEntity = $this->findProfile($context, $profileId);
- if (!\in_array($profileEntity->getType(), [ImportExportProfileEntity::TYPE_EXPORT, ImportExportProfileEntity::TYPE_IMPORT_EXPORT], true)) {
+ if (
+ !\in_array($profileEntity->getType(), [ImportExportProfileEntity::TYPE_EXPORT, ImportExportProfileEntity::TYPE_IMPORT_EXPORT], true)
+ && $activity !== ImportExportLogEntity::ACTIVITY_INVALID_RECORDS_EXPORT
+ ) {
throw a ProfileWrongTypeException($profileEntity->getId(), $profileEntity->getType());
}
英文:
> We assume that Shopware internally tries to also export the data, to use it for the error report?
Yes, that's it. I think this can be considered a bug, could you report it please?
If it's urgent you can patch it for the time being:
diff --git a/src/Core/Content/ImportExport/Service/ImportExportService.php b/src/Core/Content/ImportExport/Service/ImportExportService.php
--- a/src/Core/Content/ImportExport/Service/ImportExportService.php (revision d832807a8e3a4e7e4cfc922e18fdf7bb8d386ac9)
+++ b/src/Core/Content/ImportExport/Service/ImportExportService.php (date 1687804790920)
@@ -51,7 +51,10 @@
): ImportExportLogEntity {
$profileEntity = $this->findProfile($context, $profileId);
- if (!\in_array($profileEntity->getType(), [ImportExportProfileEntity::TYPE_EXPORT, ImportExportProfileEntity::TYPE_IMPORT_EXPORT], true)) {
+ if (
+ !\in_array($profileEntity->getType(), [ImportExportProfileEntity::TYPE_EXPORT, ImportExportProfileEntity::TYPE_IMPORT_EXPORT], true)
+ && $activity !== ImportExportLogEntity::ACTIVITY_INVALID_RECORDS_EXPORT
+ ) {
throw new ProfileWrongTypeException($profileEntity->getId(), $profileEntity->getType());
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论