Postponed
Project:
Drupal core
Version:
main
Component:
views.module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2021 at 15:34 UTC
Updated:
2 Aug 2024 at 11:44 UTC
Jump to comment: Most recent
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.
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 themRss::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.n/a
Rss::channel_elements is rewritten to camel-case format there may a deprecation for its old notationn/a
Fix usage of undefined properties in Rss views style plugin
Comments
Comment #2
hctomUpdate: I just found out that both properties are accessed from the outside in
template_preprocess_views_view_rss(). Therefore those have to be defined as public properties... andRoss::channel_itemsmay need a rewrite to camel-case format to fulfill code style rules.Issue description is also updated the with these findings.
Comment #5
andypostComment #6
andypostBoth elements already defined and used so probably
\Drupal\views\Plugin\views\style\Rss::getChannelElementsshould be defined as as public and another method for namespacesComment #7
andypostre-parented to #2052421: [META] Rename Views properties to core standards
Comment #9
andypostbetter title
Comment #10
quietone commentedThis is a coding standard fix and they are now done by sniff, not file. See #3346468: [meta] Fix class properties violating Drupal.NamingConventions.ValidVariableName.LowerCamelName
Comment #12
quietone commented