Undefined index when opening the feed with Twig Debugging

Created on 20 August 2020, almost 4 years ago
Updated 27 March 2024, 3 months ago

Problem/Motivation

During development if I have Twig Debugging enabled in services.yml opening the RSS feed produces PHP notices.

Steps to reproduce

1. enable twig debugging as written in the docs https://www.drupal.org/docs/theming-drupal/twig-in-drupal/debugging-twig... β†’
2. create an RSS view.
3. when you open the RSS feed, this is appended to the logs:

Notice: Undefined index: host in Drupal\podcast\Plugin\views\style\Rss->getPodcastElements() (line 249 of /var/www/html/drupal1.localhost/docroot/modules/contrib/podcast/src/Plugin/views/style/Rss.php) 

Proposed resolution

When getting the itunes image URL, the following is read from the views field:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_field' -->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/views/views-view-field.html.twig' -->
https://drupal1.localhost/themes/custom/mytheme/images/logo.png
<!-- END OUTPUT from 'core/themes/stable/templates/views/views-view-field.html.twig' -->

That way the URL is not parsed properly. The module later doesn't check if the $parsed_image_field array has the indexes it wants to read or not.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia kaszarobert

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.

Production build 0.69.0 2024