【问题标题】:Sylius: Channel not found in custom commandSylius:自定义命令中未找到频道
【发布时间】:2021-04-13 07:16:41
【问题描述】:

在自定义命令中使用默认 Sylius CompositeChannelContext 会出错,找不到该频道。

  [Sylius\Component\Channel\Context\ChannelNotFoundException]                                                    
  Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development. 

在 Profiler 中更改它并没有什么不同。

我应该如何在 Command 中使用 ChannelContext?

【问题讨论】:

标签: sylius


【解决方案1】:

以低优先级创建 CustomChannelContext 使我能够绕过此错误。现在,每当调用 CompositeChannelContext 时,它最后都会通过我的 CustomChannelContext 并获取存储库中的最后一个通道。

【讨论】:

    猜你喜欢
    • 2020-02-21
    • 2015-05-29
    • 1970-01-01
    • 2023-04-09
    • 2021-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-04
    相关资源
    最近更新 更多