Problem/Motivation

PHPSTAN show this notice:
Line src/HtmlTitleFilter.php
------ -----------------------------------------------------------------------
74 Call to deprecated method renderPlain() of interface
Drupal\Core\Render\RendererInterface:
in drupal:10.3.0 and is removed from drupal:12.0.0. Use
\Drupal\Core\Render\RendererInterface::renderInIsolation() instead.
🪪 method.deprecated

Proposed resolution

This should be fixed, and possible covered with test.

Issue fork html_title-3570683

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vitaliyb98 created an issue. See original summary.

atoll made their first commit to this issue’s fork.

atoll’s picture

Assigned: Unassigned » atoll
Issue tags: +LutskGCW26

atoll’s picture

Assigned: atoll » Unassigned
Status: Active » Needs review

Update: I replaced the deprecated RendererInterface::renderPlain() with renderInIsolation() as suggested by core deprecation notice.
However, the GitLab CI build now fails with PHPUnit failures that appear to be caused by test expectations around renderable arrays and allowed tags, rather than the deprecation fix itself.

In particular, HtmlTitleFilterTest dataset #8 currently expects renderable array input to preserve allowed markup (), i.e. 'Test renderable array', but after switching away from renderPlain() the actual output becomes 'Test renderable array' (markup is stripped/handled differently).
Additionally, the functional test HtmlTitleViewsTest::testViewsRssStyle expects RSS output Test sup-tag, but the generated differs with the new rendering behavior.

vitaliyb98’s picture

Status: Needs review » Fixed

Merged into 8.x-1.x, thanks!
I will also create an issue for fixing the failed test, whichis is related to the RSS (isn't related to this task)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.