Skip to content

Commit

Permalink
Quick Edit: Fix JS error when bulk editing pages (WordPress#66358)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: oandregal <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent a02ce46 commit 4440247
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/edit-site/src/components/post-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 4440247

Please sign in to comment.