Forums OroCRM OroCRM – How do I? Questions How to enable tag and attachments for BusinessUnit

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

  • Creator
  • #26539


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


    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



    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.