Rss views style plugin channel_elements property needs rename

Created on 21 April 2021, over 3 years ago
Updated 2 August 2024, 5 months ago

Problem/Motivation

The Rss view style plugin sets some namespaces and its channel elements in a class property but never defines it. As these properties are accessed from the outside in template_preprocess_views_view_rss() those should be defined as public properties.

Steps to reproduce

  • Check Drupal\views\Plugin\views\style\Rss::render() method's code in core/modules/views/src/Plugin/views/style/RssExtended.php to see that $this->namespaces and $this->channel_elements are assigned some values without ever defining them

Proposed resolution

  • Define both mentioned properties as public class properties
  • See if Rss::channel_items has to be rewritten in camel-case format to Rss::channelElements to fulfill code style rules. If so, there has to be a fallback mechanism (e.g. via magic __get() method to still allow (but deprecate) usage of Rss::channel_elements. Another option is to provide getter methods for these properties, but this may result in even more backwards compatibility issues.

Remaining tasks

  • Create an issue fork or a patch to fix this issue

User interface changes

n/a

API changes

  • If Rss::channel_elements is rewritten to camel-case format there may a deprecation for its old notation

Data model changes

n/a

Release notes snippet

Fix usage of undefined properties in Rss views style plugin

πŸ“Œ Task
Status

Postponed

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated 28 minutes ago

Created by

πŸ‡©πŸ‡ͺGermany hctom

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.71.5 2024