Skip to content

Drupal 12 compatibility: renderPlain() → renderInIsolation() - #17

Open
RobinHoutevelts wants to merge 2 commits into
mainfrom
d12
Open

Drupal 12 compatibility: renderPlain() → renderInIsolation()#17
RobinHoutevelts wants to merge 2 commits into
mainfrom
d12

Conversation

@RobinHoutevelts

@RobinHoutevelts RobinHoutevelts commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • RendererInterface::renderPlain() is deprecated in drupal:10.3.0 and removed in drupal:12.0.0, in:
    • src/MessageBuilder.php (setBody())
    • src/Plugin/Mail/PlainMailableFormatter.php (formatHtml())
  • Both call sites now go through DeprecationHelper::backwardsCompatibleCall() (change record): renderInIsolation() on core ≥10.3, renderPlain() below — so the branch stays deprecation-free on current core and keeps working on older supported cores.

Core requirement

DeprecationHelper itself only exists since Drupal 10.1, so core_version_requirement/composer narrow minimally from ^9.3 || ^10 || ^11 to ^10.1 || ^11 (Drupal 9 is EOL; no ^12 claim until D12 is released).

No other D12/Symfony 7 removals found in src/.


Found by a drupal/upgrade_status 5.x scan on Drupal 11.4 (intranet.uzleuven.be upgrade); every finding was re-verified against main HEAD before fixing, the pushed diff was independently re-reviewed, and the branch was exercised on a real 11.4 site (full PHPUnit + Playwright e2e suites green with the project pinned to this branch).

🤖 Generated with Claude Code

https://claude.ai/code/session_015EeazvHFUoYTXZGXAN5SZc

RobinHoutevelts and others added 2 commits July 6, 2026 08:41
- Replaced Renderer::renderPlain() with Renderer::renderInIsolation()
  in MessageBuilder::setBody() and PlainMailableFormatter::formatHtml(),
  since renderPlain() is deprecated in drupal:10.3.0 and removed in
  drupal:12.0.0. renderInIsolation() is a drop-in replacement with the
  same signature and behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EeazvHFUoYTXZGXAN5SZc
Use DeprecationHelper::backwardsCompatibleCall() (drupal.org/node/3379306)
so the branch keeps working on every core version its APIs exist on,
instead of hard-requiring the newest API:
- render uses renderInIsolation() on >=10.3 and renderPlain() below

DeprecationHelper itself only exists since Drupal 10.1, so the core
requirement narrows minimally from ^9.x to ^10.1 || ^11 (no ^12 claim
until Drupal 12 is released).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EeazvHFUoYTXZGXAN5SZc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant