Drupal 12 compatibility: renderPlain() → renderInIsolation() - #17
Open
RobinHoutevelts wants to merge 2 commits into
Open
Drupal 12 compatibility: renderPlain() → renderInIsolation()#17RobinHoutevelts wants to merge 2 commits into
RobinHoutevelts wants to merge 2 commits into
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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())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
DeprecationHelperitself only exists since Drupal 10.1, socore_version_requirement/composer narrow minimally from^9.3 || ^10 || ^11to^10.1 || ^11(Drupal 9 is EOL; no^12claim until D12 is released).No other D12/Symfony 7 removals found in
src/.Found by a
drupal/upgrade_status5.x scan on Drupal 11.4 (intranet.uzleuven.be upgrade); every finding was re-verified againstmainHEAD 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