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
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
Comment #3
atoll commentedComment #5
atoll commentedUpdate: 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.
Comment #6
vitaliyb98 commentedMerged 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)