OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 12 replies, has 4 voices, and was last updated by  Anonymous 9 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #35726

    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
  • #35727

    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?

    #35728

    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.

    #35729

    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.

    #35730

    SHAD0WF4X
    Participant

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

    #35731

    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.

    #35732

    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?

    #35733

    SHAD0WF4X
    Participant

    I added this:

    To my controller and now i get this error:

    Please help me out

    #35734

    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.

    #35735

    SHAD0WF4X
    Participant

    Thanks, this helped me!

    #35736

    Anonymous

    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.

    #35737

    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.

    #35738

    Anonymous

    Thank you for the answer Alexandr!

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

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top