fix: #3040302 "Edit summary" button for the text with summary widget has unthemable markup

On unrouted requests such as 404 pages, \Drupal::routeMatch()->getRouteName() returns NULL via NullRouteMatch. Passing NULL to str_starts_with() triggers a PHP 8.1+ deprecation warning:

▎ str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated

▎ The fix adds a null guard before the str_starts_with() call in DisplayPluginBase::viewExposedFormBlocks(). A kernel test is added to ExposedFormRenderTest that overrides the route match service with NullRouteMatch and verifies the method runs cleanly.

Edited by Zeeshan khan

Merge request reports

Loading