Skip to content
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

Image Block: Media Sources Menu Inserted When Adding Caption #37943

Closed
taipeicoder opened this issue Jun 19, 2024 · 8 comments · Fixed by #37987
Closed

Image Block: Media Sources Menu Inserted When Adding Caption #37943

taipeicoder opened this issue Jun 19, 2024 · 8 comments · Fixed by #37987
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Extension] External Media Extend all block editor media tools to support external providers [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@taipeicoder
Copy link
Contributor

taipeicoder commented Jun 19, 2024

Impacted plugin

Jetpack

Quick summary

When adding a caption to an image, the media sources menu is unexpectedly inserted between the image and the caption. See screenshot for reference:

Screenshot 2024-06-19 at 10 54 40 AM

Or a recording:

Screen.Capture.on.2024-06-19.at.11-02-38.mp4

Notes:

  • This also happens in the Gallery block.
  • Clicking on the menu items results in the media sources menu to be removed.
  • This happens in Gutenberg 18.5, downgrading to 18.4.1 and the issue is not reproducible.
  • This issue does not happen if Jetpack is disabled.

Steps to reproduce

  1. Create a new JN sites.
  2. Install Gutenberg 18.5.
  3. Connect Jetpack.
  4. Head to the Site Editor, and add an image block.
  5. Click on the Add caption button, and observe the issue described above.

A clear and concise description of what you expected to happen.

For the image caption input field to be displayed.

What actually happened

The image caption input field was displayed, but also the media sources menus is rendered along with it.

Impact

Some (< 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Atomic, Self-hosted

Logs or notes

8351984-zd-a8c
8354098-zd-a8c
8354676-zd-a8c

@taipeicoder taipeicoder added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Jun 19, 2024
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jun 19, 2024
@github-actions github-actions bot added [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack labels Jun 19, 2024
Copy link
Contributor

github-actions bot commented Jun 19, 2024

Support References

This comment is automatically generated. Please do not edit it.

  • 8351984-zen
  • 8354098-zen
  • 8354676-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Jun 19, 2024
@jeherve jeherve added the [Extension] External Media Extend all block editor media tools to support external providers label Jun 19, 2024
@jeherve
Copy link
Member

jeherve commented Jun 19, 2024

I'm thinking this may be related to the recent work on block bindings in core. @Automattic/frontity Is that something that's come up in your work in the past few weeks?

Those media sources are added by Jetpack by hooking into blocks.registerBlockType:

function insertExternalMediaBlocks( settings, name ) {
if ( name !== 'core/image' ) {
return settings;
}
return {
...settings,
keywords: [ ...settings.keywords, ...mediaSources.map( source => source.keyword ) ],
};
}

@SantosGuillamot
Copy link

I'm thinking this may be related to the recent work on block bindings in core. Is that something that's come up in your work in the past few weeks?

I don't think any of the changes we added in that release should affect this functionality. We are working on the image caption now, but it hasn't been merged into Gutenberg yet.

I can try to help if I am able to reproduce the error in a local instance of the Gutenberg repo. Which is the best way to test this extension? Can I install it somehow to my local site?

@liviopv liviopv added Triaged and removed Needs triage Ticket needs to be triaged labels Jun 19, 2024
@matticbot matticbot moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Jun 19, 2024
@liviopv
Copy link

liviopv commented Jun 19, 2024

📌 REPRODUCTION RESULTS

  • Tested on Simple – Replicated
  • Tested on Atomic – Replicated
  • Local site - No

📌 FINDINGS/SCREENSHOTS/VIDEO
Atomic with GB 18.5
https://github.com/Automattic/jetpack/assets/14153300/c9f29820-bbb8-44ec-b8ce-5eb1bce0e696

Atomic without GB 18.5 but with WordPress 6.6 beta 3
CleanShot 2024-06-19 at 11 48 39@2x

Dotcom Simple
CleanShot 2024-06-19 at 11 52 44@2x

Local site with WordPress 6.6 Beta 3 + GB 18.5

CleanShot.2024-06-19.at.11.51.47.mp4

📌 ACTIONS

  • Triaged

@jeherve
Copy link
Member

jeherve commented Jun 19, 2024

Thanks for taking a look!

I can try to help if I am able to reproduce the error in a local instance of the Gutenberg repo. Which is the best way to test this extension? Can I install it somehow to my local site?

Your local developement environment would need to be publicly available, so you can connect the Jetpack plugin to WordPress.com. Here in the Jetpack division we tend to rely on PCYsg-GJ2-p2 to make our local environments publicly available, but it does require a bit of setup.

Local site - No

The Jetpack plugin doesn't seem to be activated on your local site, so you won't be able to replicate the problem since the External Media feature is only available on sites using the Jetpack plugin.

@liviopv
Copy link

liviopv commented Jun 19, 2024

The Jetpack plugin doesn't seem to be activated on your local site, so you won't be able to replicate the problem since the External Media feature is only available on sites using the Jetpack plugin.

I know! That was just to confirm it was Jetpack-specific :)

@SantosGuillamot
Copy link

I tried to reproduce it using in Gutenberg (without JetPack) the same filters you shared, but I wasn't able to. I also tried setting up JetPack locally but, after tunneling it to my local domain, wp-admin is redirected so I can't connect it to WordPress.com.

By the way, these are the changes introduced in Gutenberg 18.5. In case you are able to identify the issue.

@jeherve
Copy link
Member

jeherve commented Jun 19, 2024

Thanks for trying! On my end I'm still thinking; I may try to see if WordPress/gutenberg#62085 played a role tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Extension] External Media Extend all block editor media tools to support external providers [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended
Development

Successfully merging a pull request may close this issue.

4 participants