You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Twitter embed fails with trailing slash on URL #12664
Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Block] EmbedAffects the Embed Block[Type] BugAn existing feature does not function as intended
Describe the bug
Attempting to embed a Tweet with a URL containing a trailing slash causes the embed to fail. While Twitter seems to default to no-slash it does not redirect a URL with a trailing slash to the no-slash version.
To Reproduce
Steps to reproduce the behavior:
Go to 'wp-admin/post-new.php'
Paste a Twitter single-Tweet URL with a trailing slash on its own or in the embed or Twitter blocks
See embed error and URL displays on the front-end instead of embed
Expected behavior
The Tweet to embed the same as with no trailing slash
Screenshots
Desktop (please complete the following information):
Initial exploration was executed by @alpinealex in #12739. It wasn't finished and this issue can be taken over by someone else. This is the latest recommendation from @notnownikki how to fix this bug:
I'd rather this removed the trailing slash if the embed failed, just so we can support embed URLs that do end with a trailing slash. That should be easy enough to do in componentDidUpdate (of edit component).
Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Block] EmbedAffects the Embed Block[Type] BugAn existing feature does not function as intended
Activity
danielbachhuber commentedon Dec 7, 2018
Thanks for the report, @kriskarkoski. This should be relatively straightforward to fix up. I've filed it against
WordPress 5.0.x Follow Upsgziolo commentedon Feb 7, 2019
Initial exploration was executed by @alpinealex in #12739. It wasn't finished and this issue can be taken over by someone else. This is the latest recommendation from @notnownikki how to fix this bug:
gbroques commentedon Mar 24, 2019
@gziolo I can take this over.
gziolo commentedon Mar 24, 2019
@gbroques, thank you 👍
gbroques commentedon Mar 24, 2019
@gziolo I believe I fixed the issue as @notnownikki suggested and put up a PR #14600.
However, I can't seem to run the e2e tests locally to fix the test that's failing the build.
I'm using the built-in local environment as suggested by the End to end testing section in the docs.
OS: Ubuntu 16.04
Docker version: 18.09.3, build 774a1f4
Docker Compose version: 1.22.0, build f46880fe
Node version: v10.15.3
notnownikki commentedon Mar 24, 2019
Fix embedding Twitter URLs with a trailing slash (Closes WordPress#12664
gbroques commentedon Mar 29, 2019
Another contributor can pick this issue up and use my PR #14600 as a starting place.
It looks like all that's needed is a fix to the e2e tests. Read the PR comments for @notnownikki's suggestion.
Hope this helps! :)
Fix embedding Twitter URLs with a trailing slash (Closes #12664)
Retry failing embeds with trailing slash (#14705)
Retry failing embeds with trailing slash (#14705)
Bug fixes from 5.4 (#14796)