Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
ef7fa382
Commit
ef7fa382
authored
4 months ago
by
Atul-Ghate
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3488290
:Aliasmanager-getaliasbypath-throws-fata.
parent
8247b90e
No related branches found
No related tags found
1 merge request
!10237
Issue #3484105 by nicxvan, godotislate: Automatically included .inc files are no longer included
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/path_alias/src/AliasManager.php
+5
-4
5 additions, 4 deletions
core/modules/path_alias/src/AliasManager.php
with
5 additions
and
4 deletions
core/modules/path_alias/src/AliasManager.php
+
5
−
4
View file @
ef7fa382
...
...
@@ -144,9 +144,11 @@ public function getPathByAlias($alias, $langcode = NULL) {
* {@inheritdoc}
*/
public
function
getAliasByPath
(
$path
,
$langcode
=
NULL
)
{
$path
??=
''
;
if
(
!
str_starts_with
(
$path
,
'/'
))
{
throw
new
\InvalidArgumentException
(
sprintf
(
'Source path %s has to start with a slash.'
,
$path
))
;
$path
=
'/'
.
$path
;
}
// If no language is explicitly specified we default to the current URL
// language. If we used a language different from the one conveyed by the
// requested URL, we might end up being unable to check if there is a path
...
...
@@ -217,7 +219,6 @@ public function cacheClear($source = NULL) {
// Note this method does not flush the preloaded path lookup cache. This is
// because if a path is missing from this cache, it still results in the
// alias being loaded correctly, only less efficiently.
if
(
$source
)
{
foreach
(
array_keys
(
$this
->
lookupMap
)
as
$lang
)
{
unset
(
$this
->
lookupMap
[
$lang
][
$source
]);
...
...
@@ -240,8 +241,8 @@ public function cacheClear($source = NULL) {
* An optional path for which an alias is being inserted.
*/
protected
function
pathAliasPrefixListRebuild
(
$path
=
NULL
)
{
// When paths are inserted, only rebuild the prefix list if the path has a
top
// level component which is not already in the prefix list.
// When paths are inserted, only rebuild the prefix list if the path has a
//
top
level component which is not already in the prefix list.
if
(
!
empty
(
$path
))
{
if
(
$this
->
pathPrefixes
->
get
(
strtok
(
$path
,
'/'
)))
{
return
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment