-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Pasting same-page link adds admin page URL #28115
Comments
@sabernhardt I couldn't replicate this issue... Does this also happen when manually entering the URL instead of copy-pasting it? Where exactly was the anchor URL copied from? I tried copying it from the "HTML Anchor" field of another block but there was no issue when I tried that either. 🤔 |
Sorry for the confusion. I did not mean the HTML Anchor field. Hopefully this clarifies it a bit:
|
Testing using WordPress 5.7 Added an internal link. Copied the text that had the link. Pasted the text and link into another text block. |
@sabernhardt Do you mean this flow? pastelink.mp4For other copy/duplication paths it looks okay: copylink.mp4 |
This issue might be associated: |
It seems this has been fixed elsewhere. I've used the Ctrl + C/V keyboard shortcuts for copying and pasting the linked text, so it's basically the same as the browser context menu (flow 1). I tried again today with 5.7 in Firefox 86.0.1, both with and without Gutenberg 10.2.1 activated.
|
Still able to reproduce this in Gutenberg 10.9.0. |
I can't reproduce this in WordPress 5.9+. Seems like this is fixed now. |
Neither am I able to reproduce; closing. |
The bug still exists (or exists again?) in WordPress 6.0.2. |
Just came up against this today myself. Can this be reopened or should I open a new issue? |
I reopened this but could you share more information about your environment; do you have the Gutenberg plugin installed? Which version of WordPress are you using? I am unable to reproduce this myself in WP 6.2 with Gutenberg 15.6.2 installed. Video shows that the copied link is reproduced correctly 2023-05-04-error.mp4 |
Apologies for the delay - it happened for me 3 times while I was migrating a site the other week, but I can't recall the exact circumstances and now am unable to replicate; I assumed based on matthiaspabst's message that it was happening more generically. Will follow up the next time it happens. |
I've managed to replicate the issue. It now only exists with a cut and paste, rather than a copy and paste. https://watch.screencastify.com/v/7Bf2BHOZJ9pufLCF1I3K
So basically, cut and paste always fails, except if re-pasting immediately where you cut it from. The link popup appears very buggy while cutting and pasting as well, appearing partially offscreen even though there is no link visible. edit - for reference, this is WP 6.2.1, no Gutenberg plugin. |
Original report by hage
Trac #52105
Describe the bug
When copying and pasting anchor links, the links have an incorrect destination by adding the page's admin URL.
Steps to reproduce the behavior:
#destination
).#destination
.Expected behavior
The link should remain a same-page link.
Screenshots
Before moving:

After moving:

Another screenshot after pasting (WP 5.6, without Gutenberg or Yoast plugins):

WordPress versions
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: