Relative schema support when rewriting views field as a link

Created on 11 November 2020, over 4 years ago
Updated 3 April 2024, about 1 year ago

Problem/Motivation

Views links alter doesn't work well with schema-relative URLs like "//cdn.site.com" provided by CDN module and similar.

Steps to reproduce

  1. Create views with any content.
  2. Switch format to show Fields instead of rendered entities.
  3. Add a custom text field and rewrite the output of this field as a custom link and put there "//example.com" (with double-slash at the start, to make the link schema relative to parent website).
  4. Save the view, you should expect to have a link to example.com but instead it shown "/".

Proposed resolution

Provide support for views altered links with the relative schema.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡ΊπŸ‡¦Ukraine zviryatko

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine zviryatko

    @quietone, I appreciate your patience. To clarify, a double slash represents a network-path reference, as explained in this link: RFC 3986 Section 4.2. Essentially, it should mimic the protocol of the current website URL. This is particularly useful when ensuring that links function seamlessly across both HTTP and HTTPS protocols, maintaining consistency and directing users to the same site. While Drupal typically generates links effectively, cached versions may cause issues if originally generated for HTTP but accessed via HTTPS.

Production build 0.71.5 2024