Closed (works as designed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
path.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Jul 2023 at 12:07 UTC
Updated:
21 Sep 2023 at 16:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andreic commentedAttaching patch
Comment #3
cilefen commentedThis looks like a workaround to some bad input. What are the steps to reproduce?
Comment #4
andreic commentedThanks, I will try to debug that part.
Comment #5
andreic commentedThis is weird, I'm getting the error when accessing paths like taxonomy/term/327.
I've upgraded to 10.1.1 and now I get:
Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\path_alias\PathProcessor\AliasPathProcessor->processOutbound() (line 54 of core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php).
Comment #6
andreic commentedIf I go to admin/structure/taxonomy/manage/tags/overview I also get it:
Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\path_alias\PathProcessor\AliasPathProcessor->processOutbound() (line 54 of core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php).
Comment #7
andreic commentedI've just tested with a clean install of 10.1.1 and when accessing admin/structure/taxonomy/manage/tags/overview it does not display the error.
It must be something with that particular client.
Comment #8
connbi commentedWhen I install pathauto module and not create alias for node, I will got error message:
Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\path_alias\PathProcessor\AliasPathProcessor->processOutbound() (line 54 of core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php).
Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\Core\Routing\UrlGenerator->generateFromRoute() (line 309 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Deprecated function: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Routing\UrlGenerator->generateFromRoute() (line 314 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Comment #9
andreic commentedI enabled pathauto and created a node without alias on a clean Drupal 10.1.1 site but I couldn't get the error.
What were your steps?
Comment #10
tcrawford commentedIt was (is) a warning (deprecation) and not an error and so you won't see it unless your error reporting is showing warnings. If time permits I will add detailed test instructions. We saw this with 9.5.x. I have not yet tested with 10.1.x, but will do.
Comment #11
papagrandeThis happened on a 9.5.x client site after I updated to PHP 8.1. I found an old path for the home page that was missing the alias, i.e. was blank. After deleting the bad alias, the errors went away.
I'm guessing the alias has been there since Drupal 7.x and PHP 5.x and only became a problem with the upgrade to PHP 8.1.
Comment #12
andreic commentedI can confirm the cause was empty aliases. In my case, empty taxonomy aliases.
Obviously, the patch I uploaded is useless at this point.
Comment #13
papagrande@andeic, thanks for the update. I think we can close this issue and hide the useless patch.
To follow up on my empty home page alias, after deleting it I ran into other problems with the metatag module and https://www.drupal.org/project/drupal/issues/1255092 since the
[current-page:url:relative]token no longer showed the alias. I ended up injecting the correct tag usinghook_metatags_alter().