strapi-plugin-content-versioning icon indicating copy to clipboard operation
strapi-plugin-content-versioning copied to clipboard

Duplicating records removes all records duplicated from

Open 5in4 opened this issue 1 year ago • 2 comments

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

  1. Install strapi & this plugin, create a new collection type, e.g. "page"

  2. Go to a list view of any content type

  3. Create and Publish a new record

  4. Go back to list view

  5. Click on "Duplicate Item line 1" (any record)

  6. Click on "Save"

  7. 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

image

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

5in4 avatar Aug 14 '23 12:08 5in4