首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从SWAG_MIGRATION_RUN_EXCEPTION迁移到shopware6时日志中的shopware6

从SWAG_MIGRATION_RUN_EXCEPTION迁移到shopware6时日志中的shopware6
EN

Stack Overflow用户
提问于 2022-07-29 17:30:25
回答 1查看 91关注 0票数 1

PHP版本: 8.1

Shopware版本: 6.4.13

预期行为:数据迁移成功,并在后端/前端可见。

实际行为:迁移的数据似乎在后端/前端中不可见,日志中也有错误。

如何复制:在虚拟环境中的本地开发环境中,我正在尝试从带有演示数据的购物软件5.7迁移到商店软件6.4。我遵循了站点https://docs.shopware.com/en/migration-en/Migrationprocess?category=migration-en/shopware5中提到的所有说明,为此我使用了本地网关设置。

虽然移民的地位是“成功”的。在shopware 6.4的后端中看不到迁移的数据,迁移过程中的日志中也有错误。我附上了一份日志以供参考。

错误日志:

代码语言:javascript
复制
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: language, sourceId: -
SwagMigrationAssistant\Migration\Logging\Log\ExceptionRunLog::__construct(): Argument #4 ($sourceId) must be of type ?string, int given, called in /var/www/webdev/shopware56/custom/plugins/SwagMigrationAssistant/Migration/Service/MigrationDataConverter.php on line 144

[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: category, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned

[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: customer_group, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned

[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: sales_channel, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
EN

回答 1

Stack Overflow用户

发布于 2022-08-01 07:32:57

造成问题的原因是PHP8.1在Shopware 5系统上的使用。

从PHP8.1开始,SELECT的数据在默认情况下不再以PHP字符串的形式返回,而是具有正确的数据类型,如整数或浮点数。请参阅https://www.php.net/manual/de/migration81.incompatible.php#migration81.incompatible.pdo

作为解决办法,您可以将Shopware 5中的PHP8.0降级为PHP8.0或将以下内容添加到config.php中:

代码语言:javascript
复制
    ...

    'db' => [
        'username' => '<your-credentials>',
        'password' => '<your-credentials>',
        'dbname' => '<your-db-name>',
        'host' => '<your-host>',

        'driverOptions' => [
            \PDO::ATTR_STRINGIFY_FETCHES => true,
        ],
    ],

    ...

对于Shopware 5.7.15,这将是默认设置。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73169064

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档