Views RSS row plugin incorrectly assumes links are relative

Created on 25 October 2017, over 6 years ago
Updated 23 May 2024, about 1 month ago

Problem/Motivation

When I create an RSS Feed view and assign the RSS setting "Link" to my path field added to the View, I'm receiving the following (example):

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: The internal path component &#039;http://cmslocal.gfs.com/en-us/ideas/minding-the-menu-labeling-law&#039; is external. You are not allowed to specify an external URL together with internal:/.

It seems like at some point the "Path" content field within Views now outputs an absolute URL. Or at least it does for me and I can't change it, even with the checkbox "Use absolute link (begins with "http://")" unchecked. Perhaps it's because my project is using the Domain module.

Regardless, I believe the RSS row plugin should allow both absolute and relative. I'm not sure there's a good reason it doesn't?

Steps to reproduce

  1. Create a views RSS feed display.
  2. Configure the display to show fields: Format > Show: Fields
  3. Add all required fields to the display.
  4. For the link field, use "Link to Content" and enable "Use absolute link" for this field.
  5. Configure the display's RSS fields:
    • Map the link field to the link field create above in #4.
    • Map the GUID field to the link field create above in #4, and enable "GUID is permalink".
  6. Save the view - however the preview most likely already failed
  7. View the page for the RSS feed
  8. Bug:
    The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: The internal path component &#039;http://cmslocal.gfs.com/en-us/ideas/minding-the-menu-labeling-law&#039; is external. You are not allowed to specify an external URL together with internal:/.
    

Proposed resolution

Update the \Drupal\views\Plugin\views\row\RssFields to detect absolute links and output them correctly.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

NA

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated less than a minute ago

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024