# Emotion Component Installer createOrUpdate orphanRemoval umgehen per Workaround?

**URL:** <https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511>\
**Category:** Programmierung\
**Created:** [16. Januar 2019 um 14:50 UTC](https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511 "2019-01-16T14:50:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![langnickel](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@langnickel](https://forum.shopware.com/u/langnickel)\
**Post date:** [16. Januar 2019 um 14:50 UTC](https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511/1 "2019-01-16T14:50:36Z")

</div>

Zur Zeit scheint ja der Shop nach neuinstallation des Plugins alle betreffenden Emotion Elemente zu löschen bei componentInstaller-\>createOrUpdate (Orphan Removal des Plugin Models auf emotionComponents?). Würde der Workaround funktionieren wenn ich vor dem createOrUpdate schaue ob es das Emotion Element gibt (componentId in DB suchen) und alle betreffenden Einträge in s\_emotion\_element die componentID auf z.B. -9999 setze und nach dem createOrUpdate wieder zurück? Würde das zu Problemen führen?

Da nach dem neu installieren das component ne neue ID bekommt müsst ja nur die neue nachschauen

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [16. Januar 2019 um 22:28 UTC](https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511/2 "2019-01-16T22:28:54Z")

</div>

Das passiert eher nach der Plugin ID in der Komponente siehe plugin Installer Service&nbsp;

---

<div class="post-metadata">

**Author:** ![langnickel](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@langnickel](https://forum.shopware.com/u/langnickel)\
**Post date:** [17. Januar 2019 um 08:19 UTC](https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511/3 "2019-01-17T08:19:13Z")

</div>

Danke @Shyim du hast recht, der ORM ist nicht schuld sonden der call auf removeEmotionComponents in der Uninstall des Plugin Installer Service. Ich setzte da mal an, danke. Komme ich irgendwie an die aktuelle plugin id in der install/uninstall eines plugins? Dann könnte der workaround klappen, sofern der service nach der uninstall methode des plugins kommt. Ansonsten müsste ich den Service dekorieren bzw der schlechteste weg nen if ($removeData) for den Aufruf in der uninstall des services setzten fürs erste bis nen patch kommt

---

<div class="post-metadata">

**Author:** ![langnickel](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@langnickel](https://forum.shopware.com/u/langnickel)\
**Post date:** [12. Februar 2019 um 08:23 UTC](https://forum.shopware.com/t/emotion-component-installer-createorupdate-orphanremoval-umgehen-per-workaround/57511/4 "2019-02-12T08:23:24Z")

</div>

Hat jemand schon was funktionierendes produktiv im Einsatz? (Bump)
