ssossossosso

Forums

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

This topic contains 3 replies, has 2 voices, and was last updated by Mike Kudelya Mike Kudelya 6 months, 4 weeks ago.

  • Creator
    Topic
  • #24378

    bosumflici
    Participant

    Hi,

    I’d like to know how can i drop/delete an attachment Association created through migrations like this:

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #24546
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    If you want to delete ‘Add Attachment’ option in ‘More Actions’ drop-down try to change this “System -> Entity Management -> [Entity] -> [Edit] -> Enable Attachments -> No”.

    #32664

    bosumflici
    Participant

    Sorry for late reply.

    No that’s not what i meant. I create an attachment relation through migration. Later i need to drop that relation. How can i do that?

    #32768
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    To remove the relation, you should first find the ID of the ‘Oro\Bundle\AttachmentBundle\Entity\Attachment’ entity in the oro_entity_config table and delete your entity field (cb_newage_panel_view) from oro_entity_config_field filtering by “where entity_id = ID”. Afterwards, please delete your entity from the oro_attachment table. Also, I have created a small hack for the entity config (oro_entity_config::data). You should modify the config of the ‘Oro\Bundle\AttachmentBundle\Entity\Attachment’ entity and delete the relation. Put the column’s data in the $str variable, recognize the relation name (in my case it is manyToOne|Oro\Bundle\AttachmentBundle\Entity\Attachment|Extend\Entity\ContactData|contact_data_ed9890f2) and unset it. Once you have done that, put it back into the oro_entity_config::data field.
    I suggest you run this code in any controller/service of your project, otherwise the unserialize function will give the wrong result.

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

You must be logged in to reply to this topic.