lautr / strapi-plugin-duplicate-button

19 stars 8 forks source link

Not working with versioning #21

Closed wojjee closed 11 months ago

wojjee commented 11 months ago

HI i think this function is not working with versionning app. Every time im creating new duplicate and publishing it the orginal content record is removed.

lautr commented 11 months ago

Hi @wojjee , unfortunately i can only expose the existing duplicate logic from within strapi so there is no way to change how the actual duplication is handled.

sushmavoleti commented 9 months ago

I also have the same problem. Did you find any solution @wojjee?

wojjee commented 9 months ago

nope, unfortunately i did not find any solution for this.

On Wed, 31 Jan 2024 at 10:03, sushmavoleti @.***> wrote:

I also have the same problem. Did you find any solution @wojjee https://github.com/wojjee?

— Reply to this email directly, view it on GitHub https://github.com/lautr/strapi-plugin-duplicate-button/issues/21#issuecomment-1918671786, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNZDJ57YGJDOC2O5Q5NFTTYRICFVAVCNFSM6AAAAAA7SQCFSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGY3TCNZYGY . You are receiving this because you were mentioned.Message ID: @.***>

sushmavoleti commented 9 months ago

I fixed it using by changing vuid in beforeCreate lifecycle hook. if (pageURL.includes("clone")) { const vuid: string = generateVUID(); event.params.data.versionNumber = 1; if (event?.model?.columnToAttribute?.vuid) event.params.data.vuid = vuid; }