gpt4 book ai didi

shopware - 重定向到 Controller 抛出 "Unfortunately, something went wrong."

转载 作者:行者123 更新时间:2023-12-02 03:09:27 29 4
gpt4 key购买 nike

我已经安装了这个插件https://github.com/shopware/swag-docs-storefront-controller在开发模板中,但是当我运行它并尝试清除购物车时,它重定向到 url 并显示错误“不幸的是,出了问题。”

在日志中我发现以下错误

request.CRITICAL: Uncaught PHP Exception Shopware\Core\Framework\Routing\Exception\InvalidRouteScopeException: "Invalid route scope for route frontend.checkout.clearCart." at /var/www/html/shopware6/vendor/shopware/platform/src/Core/Framework/Routing/RouteScopeListener.php line 93 {"exception":"[object] (Shopware\Core\Framework\Routing\Exception\InvalidRouteScopeException(code: 0): Invalid route scope for route frontend.checkout.clearCart. at /var/www/html/shopware6/vendor/shopware/platform/src/Core/Framework/Routing/RouteScopeListener.php:93)"} []

但是这在安装程序设置中运行良好。

最佳答案

您需要向 Controller 添加路由范围。从几周前开始,这是强制性的,但似乎示例并未据此进行更改。

https://docs.shopware.com/en/shopware-platform-dev-en/getting-started/recent-updates#routescope-details

将 Routescope-annotation 添加到 Controller 应该就足够了: https://github.com/shopware/swag-docs-storefront-controller/blob/master/src/Storefront/Controller/ClearCartController.php#L23

只需将其添加到注释中即可:

 * @RouteScope(scopes={"storefront"})

并添加路由范围:

use Shopware\Core\Framework\Routing\Annotation\RouteScope;

我将准备一个拉取请求来修复它。

关于shopware - 重定向到 Controller 抛出 "Unfortunately, something went wrong.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58091745/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com