- Issue created by @andreic
- Status changed to Postponed: needs info
almost 2 years ago 12:41pm 3 July 2023 This looks like a workaround to some bad input. What are the steps to reproduce?
- last update
almost 2 years ago Custom Commands Failed - π·π΄Romania andreic
This 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).
- π·π΄Romania andreic
If 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).
- π·π΄Romania andreic
I'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. When 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).- π·π΄Romania andreic
I 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? - π¨πSwitzerland tcrawford
It 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.
- πΊπΈUnited States papagrande US West Coast
This 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.
- π·π΄Romania andreic
I can confirm the cause was empty aliases. In my case, empty taxonomy aliases.
Obviously, the patch I uploaded is useless at this point. - Status changed to Closed: works as designed
over 1 year ago 4:49pm 21 September 2023 - πΊπΈUnited States papagrande US West Coast
@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 π url() should return / when asked for the URL of the frontpage Needs work since the
[current-page:url:relative]
token no longer showed the alias. I ended up injecting the correct tag usinghook_metatags_alter()
.