Problem/Motivation

The RSS 2.0 spec includes an optional "image" element. The RSS style does not currently permit this popular element to be set.

Proposed resolution

Add an optional "Image" option to Rss style.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

grasmash created an issue. See original summary.

grasmash’s picture

Status: Active » Needs review
StatusFileSize
new5.7 KB

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wjackson’s picture

StatusFileSize
new5.09 KB

The patch works as expected and adds the Image element to the RSS channel. The following patch cleans up the field labels to remove some unnecessary formatting.

runeasgar’s picture

  1. Reproducing undesirable behavior. Creating 2 test articles with images, and an RSS view & display of articles. Located where it appears an image option should be: "Feed: Row Style Options". Confirmed "Image" is not one of the options.
  2. Applying patch: $ curl -l https://www.drupal.org/files/issues/2018-04-13/rss-feed-image-2924204-4.patch | git apply -v
  3. Applied clean.
  4. Canceled out of the view creation.
  5. Deleted the view I had created (apparently it had already been created at this point).
  6. drush cr
  7. Redoing step 1: still don't see an "Image" option.

I may be testing this incorrectly, given that @wjackson already indicated it was working as expected. So, leaving this as "Needs review".

Steps to reproduce would be helpful. Happy to re-test once those are provided.

runeasgar’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new102.64 KB

Nevermind, figured it out. This is for an image for the feed, not for each feed item. Located under the display's "Format" -> "Settings", with "RSS Feed" selected". Re-testing:

  1. Create 1 test article. Not sure it's needed, but.. meh.
  2. Creating an articles view.
  3. Creating a feed display.
  4. Checking Format -> Format -> Settings.
  5. No image option available. Undesirable behavior confirmed. Also gave it a path, saved it, and looked in data. Confirmed no image info.
  6. Applying patch: curl -l https://www.drupal.org/files/issues/2018-04-13/rss-feed-image-2924204-4.patch | git apply -v
  7. Applied clean.
  8. drush cr
  9. Exited out and deleted my articles view.
  10. Redoing steps 2 through 5: success, image option available (screenshot embedded at bottom of this comment). Added URL, and it appears in feed data.
  11. Unfortunately, the feed data looks a little messed up both visually and functionally. See below:
<channel>
    <title></title>
    <link>http://sprint-20180413-0916.ddev.local:8080/articles</link>
    <description></description>
    <language>en</language>
          <image>
        <url>http://www.google.com/image</url>
        <title></title>
        <link>http://sprint-20180413-0916.ddev.local:8080/articles</link>
      </image>

I think this "Needs work", but feel free to correct that if I'm wrong. Also, this will probably require tests? I won't add "Needs tests" just yet, since the patch doesn't appear to be working.

runeasgar’s picture

Looking at the RSS 2.0 image spec:
https://validator.w3.org/feed/docs/rss2.html#ltimagegtSubelementOfLtchan...

Looks like the title and link tags are part of the spec, which I didn't realize. So, it looks like this is only visually messed up, not functionally.

Also, should the link tag should be linking to the site, not necessarily the view? Dunno. The language doesn't seem to clarify. Regardless, that seems like nitpicking.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

didebru’s picture

Issue summary: View changes
StatusFileSize
new93.96 KB

Am I get this right, this patch will provide one global image for an whole rss view?
Why not adding it here as per row e.g.
url="http://www.foo.com/movie.mov"
fileSize="12216320"
type="video/quicktime"
medium="video"
isDefault="true"
expression="full"
bitrate="128"
framerate="25"
samplingrate="44.1"
channels="2"
duration="185"
height="200"
width="300"
lang="en" />?

drup16’s picture

This patch seems to only allow for an image for the entire `RSS`, not single rows that are returned in the feed.

drup16’s picture

I am adding reference to related issue that will return <enclosure> for each item returned. Patch #4 will only add the Image element to the RSS channel.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pobster’s picture

Status: Needs work » Needs review
StatusFileSize
new5.08 KB

Rerolling patch for testing on 8.9.x

And yes ... this is different functionality from attaching an image to each item, please check the RSS spec.

pobster’s picture

StatusFileSize
new5.05 KB

Core doesn't really care about tidy whitespace ... but I see that's what's being requested here.

The last submitted patch, 14: rss-feed-image-2924204-14.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 15: rss-feed-image-2924204-15.patch, failed testing. View results

pobster’s picture

Status: Needs work » Needs review
StatusFileSize
new6.74 KB

Hmmm new tests ...

Status: Needs review » Needs work

The last submitted patch, 18: rss-feed-image-2924204-18.patch, failed testing. View results

pobster’s picture

StatusFileSize
new6.74 KB

Ugh ... apologies, I changed the whitespace ~ updated the hash.

pobster’s picture

Status: Needs work » Needs review

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pjudge’s picture

I'm not a patch wizard, have only done this a handful of times, but I think there might be some text at the top of the patch in #20 (from, date, subject) that is interfering with my ability to apply the patch. Not sure if other people experience this as well. I'm using composer.

pobster’s picture

Hiya!

Nah that's standard formatting; https://git-scm.com/docs/git-format-patch

It's more likely that it just needs rerolling for the current 8.9.x-dev branch.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

playful’s picture

#20 is working for me on D8.9.7, but there are 7 extra "+" symbols that are actually outputted in the feed.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

playful’s picture

#20 seems to be working on D9.2.9.

pobster’s picture

That's odd - there are double ++ in the patch ... that'll be why. I'll reroll it a bit later.

pobster’s picture

StatusFileSize
new6.74 KB
playful’s picture

#30 working on D9.2.9 with php 7.4. Thanks!

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new159 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new2.91 KB

Rerolled for 11.x.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Believe this will need test coverage as well.

Thanks!

uberengineer’s picture

StatusFileSize
new2.78 KB

Rerolled for 10.2.x

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.