From 4440247e97db0c3ad220d1cad07fb98156a5418b Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 23 Oct 2024 09:52:55 +0100 Subject: [PATCH] Quick Edit: Fix JS error when bulk editing pages (#66358) Co-authored-by: youknowriad Co-authored-by: oandregal --- packages/edit-site/src/components/post-edit/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js index 0ec63589d9767..8d7e09c702047 100644 --- a/packages/edit-site/src/components/post-edit/index.js +++ b/packages/edit-site/src/components/post-edit/index.js @@ -65,13 +65,18 @@ function PostEditForm( { postType, postId } ) { const onChange = ( edits ) => { for ( const id of ids ) { if ( + edits.status && edits.status !== 'future' && record.status === 'future' && new Date( record.date ) > new Date() ) { edits.date = null; } - if ( edits.status === 'private' && record.password ) { + if ( + edits.status && + edits.status === 'private' && + record.password + ) { edits.password = ''; } editEntityRecord( 'postType', postType, id, edits );