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 blocks with www links append the site's base URL to the link. #35910

Open
Robertght opened this issue Oct 25, 2021 · 3 comments
Open

Image blocks with www links append the site's base URL to the link. #35910

Robertght opened this issue Oct 25, 2021 · 3 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@Robertght
Copy link

Description

This is a replica of this report Automattic/wp-calypso#57305


Quick summary

If you add a link to an image in Gutenberg with the www prefix, the link will appear on the live site with the base URL of the WordPress site appended to the link address.

What you expected to happen

The link should follow the same behaviour as links added in paragraph blocks: The www. site should be linked correctly.

What actually happened

The link 404's as the base wordpress site URL is appended to the beginning of the link.

Context

Operating System

macOS

Browser

Mozilla Firefox

Theme-specific issue?

No response

Other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

Yes, easy to implement

Workaround details

Removing the link from the image block, and then re-adding it as https://www.link.com will work.

Removing the image block and re-adding it may be necessary.

Step-by-step reproduction instructions

  1. Create an image block in the editor. Link it as so (www.speedtest.net is used as an example here):

Image Link Bug Simple Link Cap

2. Go into preview or the live site, and hover over the image:

Link Bug end result

3. Clicking the link will result in a 404 error on the wordpress site, as it tries to go to: https://wordpress-site/www.speedtest.net

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 5.8.1
  • Gutenberg 11.7.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@glendaviesnz glendaviesnz added [Block] Image Affects the Image Block [Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended labels Oct 26, 2021
@glendaviesnz
Copy link
Contributor

glendaviesnz commented Oct 26, 2021

I was able to replicate this on trunk - www.google.com was incorrectly link when add via link toolbar option on Image block, but worked as expected when added with Paragraph block link toolbar option. This will also affect the new Gallery block.

@skorasaurus
Copy link
Member

skorasaurus commented Mar 8, 2023

still able to reproduce this on WP 6.1; Gutenberg 15.2.4;

worth determining whether the code that fixed this issue for buttons at #47311 could be reproduced here.

@porg
Copy link

porg commented Jul 28, 2023

A very similar link completion bug will be worked on soon, so I pointed them here to also include this very bug in that fix, if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants