ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 12 replies, has 4 voices, and was last updated by  nanaki82 2 years, 10 months ago.

  • Creator
    Topic
  • #4279

    SHAD0WF4X
    Participant

    Hello,

    I wanted to add tags to my project entity so I did the same as the account entity. Everything looks great now and I can select tags. Unfortunately they are not saved. So it keeps saying no tags. I figured out I needed a ProjectHandler, which I created like AccountHandler, but still it is not working. Next I figured out I needed some service.yml file which I created like this:

    Still the tags are not being saved. What am I doing wrong?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Author
    Replies
  • #4295
    ishakuta
    ishakuta
    Participant

    Hello, SHAD0WF4X

    Are you sure you’re correctly created ProjectHandler (should implement TagHandlerInterface)?
    Can you probably post it’s content (as well as services.yml) somewhere on pastebin.com, etc?

    #4296

    SHAD0WF4X
    Participant

    is my ProjectHandler and is my services.yml. I placed a breakpoint in the handler on every method, but it reaches none of them.

    #4297

    SHAD0WF4X
    Participant

    http://pastebin.com/fe66zP0W is my ProjectHandler and http://pastebin.com/g62iS3HG is my services.yml. I placed a breakpoint in the handler on every method, but it reaches none of them.

    #4298

    SHAD0WF4X
    Participant

    My bad, http://pastebin.com/FdyTc693 is my services.yml

    #4299
    ishakuta
    ishakuta
    Participant

    Just to be sure, are you using twm_orocrm_project.form.handler.project handler in your Project controller?

    I’ll try re-create your scenario and let you know.

    #4323

    SHAD0WF4X
    Participant

    I’m not using it in my conroller. That might be the problem. Can you explain me why and how to use it?

    #4427

    SHAD0WF4X
    Participant

    I added this:

    To my controller and now i get this error:

    Please help me out

    #4432

    Alexandr Smaga
    Participant

    Hello.

    Let’s start from scratch!
    First of all entity that you wants to make taggable should implements Oro\Bundle\TagBundle\Entity\Taggable interface.
    Here is example of implementation.

    After that you will be able to add tag selector field to form using following code

    and also form theme import is required in template

    and last thing left is to call TagManager#process after success form submit.

    You can inject tag manager using DIC just by adding tag – { name: oro_tag.tag_manager }
    and your form handler should be manager aware by implementing Oro\Bundle\TagBundle\Form\Handler\TagHandlerInterface or directly inject oro_tag.tag.manager to constructor.

    #4445

    SHAD0WF4X
    Participant

    Thanks, this helped me!

    #5084

    nanaki82
    Participant

    Hi,

    I have antoher problem saving tags… I follow/copied the contact bundle to activate tags on my entity. When I save the tags:

    raised an exception on DB because the field “alias” is not set (null). Where I can set the alias? I saw that $tagManager have a ObjectMapper with a $mappingConfig array that contains all the Bundle Class that have tags activated (and the “alias” field) but not my Entity.

    Regards, C.

    #5088

    Alexandr Smaga
    Participant

    Hello.

    Unfortunately tag functionality relies on search configuration, so you should add your entity to search index using search.yml. We will plan an improvement for this.

    #5095

    nanaki82
    Participant

    Thank you for the answer Alexandr!

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.