From d1179e3999cba5a022981042262c8e44e26c53d1 Mon Sep 17 00:00:00 2001 From: Bartholomew Date: Wed, 29 Jan 2020 18:54:01 +0100 Subject: [PATCH] fix: media file path (#3166) --- packages/netlify-cms-core/src/backend.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/netlify-cms-core/src/backend.ts b/packages/netlify-cms-core/src/backend.ts index 53a68805..a664a7e2 100644 --- a/packages/netlify-cms-core/src/backend.ts +++ b/packages/netlify-cms-core/src/backend.ts @@ -691,7 +691,12 @@ export class Backend { assetProxies.map(asset => { // update media files path based on entry path const oldPath = asset.path; - const newPath = selectMediaFilePath(config, collection, entryDraft.get('entry'), oldPath); + const newPath = selectMediaFilePath( + config, + collection, + entryDraft.get('entry').set('path', path), + oldPath, + ); asset.path = newPath; }); } else {