From 970529570b11bbcf3fb65e91f2be09b699b20be7 Mon Sep 17 00:00:00 2001 From: Bartholomew Date: Tue, 31 Mar 2020 12:58:30 +0100 Subject: [PATCH] fix: media files when duplicating entry (#3507) --- packages/netlify-cms-core/src/actions/entries.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/netlify-cms-core/src/actions/entries.ts b/packages/netlify-cms-core/src/actions/entries.ts index 8df7afcd..8ba5fb0b 100644 --- a/packages/netlify-cms-core/src/actions/entries.ts +++ b/packages/netlify-cms-core/src/actions/entries.ts @@ -211,7 +211,10 @@ export function createDraftFromEntry(entry: EntryValue) { export function draftDuplicateEntry(entry: EntryMap) { return { type: DRAFT_CREATE_DUPLICATE_FROM_ENTRY, - payload: createEntry(entry.get('collection'), '', '', { data: entry.get('data') }), + payload: createEntry(entry.get('collection'), '', '', { + data: entry.get('data'), + mediaFiles: entry.get('mediaFiles').toJS(), + }), }; }