Drupal\Core\Render\Renderer::render with $is_root_call is deprecated in drupal:11.2.0

Created on 22 August 2025, about 2 months ago

Problem/Motivation

As of Drupal 11.2.0, using \Drupal\Core\Render\Renderer::render() with the second argument $is_root_call is deprecated and will be removed in Drupal 12.0.0.

The current implementation in GeofieldGoogleMapViewStyle::render() calls:

$rendered = $this->renderer->render($build, TRUE);

This triggers a deprecation warning:

Drupal\Core\Render\Renderer::render with $is_root_call is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use Drupal\Core\Render\Renderer::renderRoot() instead.

This causes noisy logs in test output and will break functionality in Drupal 12.

Steps to reproduce

  1. Install the geofield_map module on a Drupal 11.2+ site.
  2. Create a View using the Geofield Google Map view style.
  3. Trigger a render of the View display (e.g. by visiting the page or running automated tests).
  4. Observe PHP deprecation notices for the use of Renderer::render() with the $is_root_call parameter.

Proposed resolution

Replace the deprecated call to Renderer::render() with Renderer::renderRoot() when rendering the $build array.

Suggested code change:

- $rendered = $this->renderer->render($build, TRUE);
+ $rendered = $this->renderer->renderRoot($build);

This eliminates the deprecation and aligns with the forward-compatible API.

Remaining tasks

  1. Get maintainer review.
  2. Commit patch.

User interface changes

None.

API changes

Replaces deprecated call to Renderer::render() with Renderer::renderRoot(). No change to public API.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

11.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States thefancywizard

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024