Problem/Motivation

language_test_page_top() passing NULL substitution to TranslatableMarkup - the cause of deprecation on PHP 8.1.

Steps to reproduce

Both fails without patch

Run core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php on PHP 8.1
Run core/modules/comment/tests/src/Functional/CommentLanguageTest.php on PHP 8.1

Proposed resolution

Fix test module and document that \Drupal\language\ConfigurableLanguageManager::getNegotiatedLanguageMethod() could return NULL

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

I cannot find any use of the method in contrib. See: http://grep.xnddx.ru/search?text=getNegotiatedLanguageMethod%28&filename=
Therefor we can make the very small API-change.

alexpott’s picture

It's not an API change. It's a documentation change that reflects the reality of the current API :)

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0223496 and pushed to 9.3.x. Thanks!

  • alexpott committed 0223496 on 9.3.x
    Issue #3240911 by andypost: language_test_page_top() causes deprecations...

Status: Fixed » Closed (fixed)

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