Make StylePluginBase::renderFields public

Created on 4 November 2016, about 8 years ago
Updated 25 February 2024, 9 months ago

API page: https://api.drupal.org/api/drupal/core%21modules%21views%21src%21Plugin%...

I would suggest to make StylePluginBase::renderFields(array $hresult) public instead of protected.

The module Views Merge Rows is a display extender plugin that modify Views output by implementing hook_views_pre_render(). As the module needs to access $view->style_plugin->rendered_fields during pre-rendering process, and because $view->style_plugin->rendered_fields is not rendered prior to the execution ofhook_views_pre_render, invoking $view->style_plugin->renderFields($view->result) is made necessary.

The access in the code is as follows:

$view->style_plugin->renderFields($view->result);
$rendered_fields = $view->style_plugin->getRenderedFields();

Prior to the proposed solution, creating a derived class of StylePluginBase was considered. However, the required property would not spread throughout all style plugins. The latter is pre-requisite because Views Merge Rows is a display extender intended to work with any style plugin.

Feature request
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated about 3 hours ago

Created by

🇨🇦Canada dgagne

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

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