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

Call url() with suitable options when generating $url from field_link #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alt36
Copy link

@alt36 alt36 commented May 12, 2020

This follows the code in theme_link_formatter_link_plain() from
link.module. When the raw internal 'url' property is simply
printed, it leads to any query parameters being stripped (and I'm
assuming e.g. that URL fragments are similarly missed off) because
of the internals of how Link sanitizes URLs.

This e.g. makes it impossible to have a carousel item linking to
a YouTube video.

NB I don't directly use the cambridge_carousel module, instead using a similar module for local purposes. However, this PR is a straight copy/paste from the change I've just deployed to my module (https://gitlab.developers.cam.ac.uk/ch/co/drupal-chem/chemistry_slideshow/-/commit/31fc72621907bac460380aeb1253b8819778f3fe)

This follows the code in theme_link_formatter_link_plain() from
link.module. When the raw internal 'url' property is simply
printed, it leads to any query parameters being stripped (and I'm
assuming e.g. that URL fragments are similarly missed off) because
of the internals of how Link sanitizes URLs.

This e.g. makes it impossible to have a carousel item linking to
a YouTube video.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant