strapi-plugin-content-versioning
strapi-plugin-content-versioning copied to clipboard
Duplicating records removes all records duplicated from
Bug report
Describe the bug
When duplicating a record, the source record disappears when publishing the new record. This happens because both records share the same vuid and are not detached from each other after duplicating. Therefore, all source records are hidden after hitting publish on the new record
Steps to reproduce the behavior
-
Install strapi & this plugin, create a new collection type, e.g. "page"
-
Go to a list view of any content type
-
Create and Publish a new record
-
Go back to list view
-
Click on "Duplicate Item line 1" (any record)
-
Click on "Save"
-
Click on "Publish"
-> only the duplicated record is visible on the list view
Expected behavior
Both, source and duplicated records, are visible after duplicating.
Screenshots
System
- Node.js version: v18.17.1
- NPM version: 9.6.7
- Strapi version: 4.12.0
- Database: postgres & sqlite
- Operating system: Debian & Macos
Additional context
- this is reproducible from a clean setup with versions indicated above
- injecting a new vuid in the beforeCreate lifecycle solves the issue, but might corrupt version history