Problem/Motivation

Recently, we found that our automated Mailchimp emails, which ingest a Views Media RSS feed, stopped generating thumbnails. We found our emails suddenly had broken images for the first time.

We're currently tracking through all the processes that could contribute to this problem, and in the process found that where media:content URLS for images previously were having the itok parameter added to them automatically, now our RSS feed had URLS WITHOUT the itok paramater.

This potentially problematic in our use case, where This Media RSS feed is the only time this particular image style is being used, and therefore is the only call to generate these particular image style thumbnails dynamically.

Doing some research, I found that in D7, the itok parameter was REQUIRED to be passed to Drupal the first time an image style file was generated, and after it was generated, the itok parameter would then be ignored. I assume this is the same practice for D8, but haven't found a good answer as of yet. But I do see that embedded images into content with the Media system are ALSO generating an itok paramater, so its a safe bet D8 needs that paramater for the initial image generation, too.

We also checked on another client site, on which we have not updated this module at all, is still adding the itok paramater in a similar RSS feed. Whereas, on the site with the broken thumbnails in the RSS feed, we had just updated the module for D9 readiness in the last month, right about the time our feed thumbnails started showing up as being broken images.

Steps to reproduce

Update to the latest version of this module's dev branch code.

Create a Views Media RSS feed.

Add an image to your "fields" list, and select an iamge style that is nto being used anywhere else on your site as the style of thumbnail.

In the RSS settings, udner "MEdia", set Media:content to be your image field.

You should find that your (example)
element is missing the itok parameter at the end of the URL.

Proposed resolution

Restore the itok parameter addition via the module code that generates the image URL.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nkraft created an issue. See original summary.

nkraft’s picture

Issue summary: View changes

cesarmiquel made their first commit to this issue’s fork.

cesarmiquel’s picture

StatusFileSize
new709 bytes

I've added a fix for this. I created a merge request and I'm providing a good ol' patch to add to composer in the meantime.

damienmckenna’s picture

Project: Views RSS: Media (MRSS) Elements » Advanced Views RSS Feed
Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Active » Needs work

Moving this over to the Advanced Views RSS Feed issue queue as I added this functionality to the main module suite.

The patch will need a reroll, and it introduces a duplicate line.

idebr’s picture

Title: Latest Dev version of module no longer adds itok parameters to image URLs in Media:content element » Restore itok parameter to image URLs in Media elements
Status: Needs work » Needs review
StatusFileSize
new1.5 KB

Attached patch implements the following changes:

  1. Reroll against latest views_rss 8.x-2.x
  2. Applies fix for both the media:content and the enclosure element
idebr’s picture

StatusFileSize
new876 bytes
new1.39 KB

Attached patch implements the following changes:

  1. Restore fileSize, the method takes an uri
damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #3366697: Plan for Advanced Views RSS Feed 8.x-2.1

That looks good, thank you.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.