-
Notifications
You must be signed in to change notification settings - Fork 852
FORNO-177: Pass mediaProps to MediaSources component during replace flow
#46881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
fae62b0 to
b7800fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where the mediaProps prop was not being passed to the MediaSources component in two specific contexts: the MediaReplaceFlow (toolbar replace button) and the replace button in media-menu.js. This caused the jetpack.externalMedia.extraMediaSources filter to receive undefined values for allowedTypes, multiple, and onSelect properties in these contexts, breaking custom media sources added via this filter.
Changes:
- Added
mediaPropsprop toMediaSourcescomponent in the MediaReplaceFlow filter context - Added
mediaPropsprop toMediaSourcescomponent in the isReplace branch of MediaButtonMenu
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
projects/packages/external-media/src/features/editor/index.js |
Passes mediaProps={ props } to MediaSources component in MediaReplaceFlow filter to enable the extraMediaSources filter to work correctly |
projects/packages/external-media/src/shared/media-button/media-menu.js |
Passes mediaProps={ mediaProps } to MediaSources component in the replace flow branch |
projects/packages/external-media/changelog/fix-missing-media-sources-prop |
Adds changelog entry documenting the fix |
Proposed changes:
mediaPropsto<MediaSources />component when rendered by the "replace" button in the block toolbar. This is required for thejetpack.externalMedia.extraMediaSourcesfilter to work correctly in this context.Other information:
Jetpack product discussion
FORNO-177
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Replacefrom the image block toolbar and chooseMy Source