Call to deprecated method renderPlain()

Created on 28 May 2025, 16 days ago

Hi folks, forgive me if I am getting confused, as it seems this specific issue was fixed in https://www.drupal.org/project/webform/issues/3463045 🐛 Replace deprecated code Fixed but it appears that the fix is not present in the codebase.

Problem/Motivation

Running webform 6.2.9 on 10.4.5 results in log messages as follows:

Call to deprecated method renderPlain() of class Drupal\Core\Render\Renderer: in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\RendererInterface::renderInIsolation() instead.

This is the change record: https://www.drupal.org/node/3407994

This is the issue where it seems to have been fixed:

https://www.drupal.org/project/webform/issues/3463045 🐛 Replace deprecated code Fixed

For example, this commit: https://git.drupalcode.org/project/webform/-/commit/e0ccc3465235720a0194...

However, looking at the source of various branches and counting references to renderPlain I get:

  • 6.x branch: 4 calls to renderPlain.
  • 6.2.x branch: 60 calls to renderPlain
  • 6.2.9 tag: 60 calls to renderPlain
  • 6.3.x branch 5 calls to renderPlain

So it looks like

  1. the changes to the 6.x branch never made it into 6.2.x and the 6.2.9 release (or possibly got reverted? )
  2. there are still some calls to renderPlain() that we need to tidy up, mostly in /src/Plugin/WebformHandler/EmailWebformHandler.php

Proposed resolution

Replace all calls to renderPlain() with renderInIsolation() and make new releases.

I'm sure there is more to it than I realise, so happy to help or be redirected to other solutions.

🐛 Bug report
Status

Active

Version

6.3

Component

Code

Created by

🇬🇧United Kingdom finn lewis Oxford

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

Comments & Activities

  • Issue created by @finn lewis
  • 🇬🇧United Kingdom finn lewis Oxford
  • 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

    6.3.x and 6.x are supposed to be the same. As of now, they are.

    It appears that in 6.3.x, all calls to ::renderPlain() are to WebformThemeManager::renderPlain(), which is OK. If there are any on 6.3.x that are not, please re-open.

    This change will not be made on 6.2.x because that version will not be compatible with Drupal 11.

  • 🇬🇧United Kingdom finn lewis Oxford

    Hi Liam,

    Thanks for the rapid reply, and for the clarification.

    So our solution is to upgrade to the 6.2.0-beta2 :)

    Many thanks,

    Finn

Production build 0.71.5 2024