1

我已经通过覆盖的路由覆盖了应用程序中的控制器并且它可以工作,但还安装了另一个插件,它覆盖了与我覆盖的相同的路由(此插件无法更改),现在商店软件支持此路由,而不是我的。

这是我要显示的控制器

namespace MyPlugin\Core\Checkout\Customer\SalesChannel;

...
class ChangeCustomerProfileRoute extends AbstractChangeCustomerProfileRoute
{
     * @Route(path="/store-api/account/change-profile", name="store-api.account.change-profile", methods={"POST"})
     */
    public function change(RequestDataBag $data, SalesChannelContext $context, CustomerEntity $customer): SuccessResponse

...

这是另一个插件中的控制器 - 我不想显示它(我需要这个插件,因为我需要功能,但我不需要这条路线)

namespace StorePlugin\Core\Checkout\Customer\SalesChannel;

...
class ChangeCustomerProfileRoute extends AbstractChangeCustomerProfileRoute
{
     * @Route(path="/store-api/account/change-profile", name="store-api.account.change-profile", methods={"POST"})
     */
    public function change(RequestDataBag $data, SalesChannelContext $context, CustomerEntity $customer): SuccessResponse

...

我已经阅读了这篇文章https://symfony.com/blog/new-in-symfony-5-1-route-annotations-priority但它不起作用,因为这不会优先考虑名称,只有 url。

如何优先考虑我的路线名称以由商店软件支持?

4

2 回答 2

1

优先级应该取决于插件加载顺序,由安装日期决定。

尝试以不同的顺序安装插件。您也可以手动更改plugin数据库表中的安装日期。

于 2022-01-19T19:32:50.543 回答
-1

作为 hack,我会尝试使用 Listen 并忽略 Shopware 中的 Route。

于 2022-01-03T15:31:31.873 回答