如何修复“此存储库只能附加到ORM可分类的侦听器" Gedmo中的错误排序? [英] How to fix "This repository can be attached only to ORM sortable listener" error in Gedmo sortable?

查看:74
本文介绍了如何修复“此存储库只能附加到ORM可分类的侦听器" Gedmo中的错误排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用StofDoctrineExtensions(这是Gedmo Doctrine Extensions的Symfony2端口)时,我的可排序行为不断出现此错误:

When usieing StofDoctrineExtensions (which is a Symfony2 port of Gedmo Doctrine Extensions) Sortable behaviour I kept on getting this error:

此存储库只能附加到ORM可排序的侦听器

This repository can be attached only to ORM sortable listener

由于我无法在官方文档中轻松找到答案,所以我在这里留下答案以供将来参考.

Since I could not easily find the answer in official docs I'm leaving an answer here for future reference.

推荐答案

您需要启用所有正在使用的侦听器.在这种情况下,可以排序.

You need to enable any listeners you are using. In this case, Sortable.

stof_doctrine_extensions:
    default_locale: en_US
    orm:
        default:
            sortable: true

对于Symfony 4,在/config/packages/stof_doctrine_extensions.yaml中添加此配置.对于旧版本的Symfony,请将其添加到config.yml.

For Symfony 4, add this configuration in /config/packages/stof_doctrine_extensions.yaml. For older versions of Symfony, add it to config.yml.

这篇关于如何修复“此存储库只能附加到ORM可分类的侦听器" Gedmo中的错误排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆