Symfony plugin sfDoctrineActAsTaggablePlugin not working

前端 未结 3 1804
-上瘾入骨i
-上瘾入骨i 2021-01-26 09:26

I want to attribute some tags to some of the objects of my doctrine model.

I found sfDoctrineActAsTaggablePlugin which seems to be precisely what I need.

The pro

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-26 09:38

    Whoop whoop!! I solved this problem, at last!

    Well... The problem is that the sfDoctrineActAsTaggablePlugin plugin does work only for taggable objects which have an id property called precisely "id". I like to put the name of the entity in the name of my properties, that's why I called the idea of my taggable entity "idea_id".

    As soon as I replaced "idea_id" by "id" everything worked like a charm (you may have several changes to do in the schema.yml and maybe even in the routing.yml file later on).

    I don't know if I'm clear enough so don't hesitate to ask me further explanations.

    Anyway that's a bit of a shame for this plugin, it is not generic enough (will report this to the developers).

    BTW, all the syntaxes for actAs written in my first post are equivalent, use whichever you prefer.

    Thank you all for your help, each reply was an encouragement without which I wouldn't have had the strength to find the bug ;).

    Cheers

提交回复
热议问题