ssossossosso

Forums

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

This topic contains 2 replies, has 2 voices, and was last updated by  Sergey 1 month, 3 weeks ago.

  • Creator
    Topic
  • #35745

    Sergey
    Participant

    Hi. I need to enable Tags and Attachments for BusinessUnit
    I can do that in ENTITY MANAGEMENT or in console with command

    but when i use entity-config:update

    all my changes desapearing

    It is easy issue for custom entities where I can add annotations

    BusinessUnit is ORO entity ( vendor/Oro/Bundle/OrganizationBundle/Entity/BusinessUnit.php)
    and it is a very bad practice to edit it but I can’t find another.

    Can you recommend some better solution of this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #35747

    mmiasnikov
    Oro Core

    Hi, @sergey.stepanchuk!

    Probably the only solution at the moment – use DB migration for this. Please, take a look at example how to set up options in OroCRMTaskBundle https://github.com/oroinc/OroCRMTaskBundle/blob/2.3/Migrations/Schema/v1_2/OroTaskBundle.php#L96-L127.

    #35772

    Sergey
    Participant

    Hi, mmiasnikov. Thanks for your answer.

    I created migration as you proposed.

    After run migration options ‘enable’ were set to ‘true’

    Unfortunately after execute

    changes disappeared

    I found another solution maybe it will be useful for other.
    I modified bundle’s install script to enable Tags and Attachments for BusinessUnit after config:update

    So after every deploy and update with force, Tags and Attachments are always enabled.

    Then I found another bad thing. When we disable Tags (in ‘entity manager’ or after ‘php app/console oro:entity-config:update –force’) all tags that we had set for BusinessUnits disapeared from them.
    I found that Tag’s relation deleted in Tag’s Entity listener – class EntityConfigListener, function postFlush (oro/platform/src/Oro/Bundle/TagBundle/EventListener/EntityConfigListener.php)
    So I decided to overwrite this listener and extend TagBundle

    And add exception for BusinessUnit

    Well, that’s how I achieved my goal

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

You must be logged in to reply to this topic.