Skip to content

Commit

Permalink
Site Editor: Fix image upload - Check for a numeric post id before ap…
Browse files Browse the repository at this point in the history
…pending to upload media data (#57040)
  • Loading branch information
glendaviesnz authored Dec 14, 2023
1 parent 2fb3c57 commit d9ea8d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/utils/media-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export default function mediaUpload( {
const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;
maxUploadFileSize =
maxUploadFileSize || getEditorSettings().maxUploadFileSize;

const currentPostId = getCurrentPostId();
uploadMedia( {
allowedTypes,
filesList,
onFileChange,
additionalData: {
post: getCurrentPostId(),
...( ! isNaN( currentPostId ) ? { post: currentPostId } : {} ),
...additionalData,
},
maxUploadFileSize,
Expand Down

1 comment on commit d9ea8d0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d9ea8d0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7204639909
📝 Reported issues:

Please sign in to comment.