- Issue created by @pfrenssen
- @pfrenssen opened merge request.
Getting a deprecation warning on PHP 8.3 when running tests:
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /modules/contrib/tmgmt/translators/tmgmt_local/src/Menu/TMGMTLocalBreadcrumbBuilder.php on line 23
The code in question is this:
if (strpos($route_match->getRouteName(), 'view.tmgmt_local_manage_translate_task') === 0 || strpos($route_match->getRouteName(), 'view.tmgmt_local_task_overview') === 0 || $route_match->getParameter('tmgmt_local_task') instanceof LocalTaskInterface || $route_match->getParameter('tmgmt_local_task_item') instanceof LocalTaskItemInterface) { return TRUE; }
It happens because
$route_match->getRouteName()
can returnNULL
if there is no route, e.g. when running on the CLI.