Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pathauto-3275041
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
pathauto-3275041
Commits
ac0355e1
Commit
ac0355e1
authored
13 years ago
by
das-peter
Committed by
Dave Reid
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1155132
: Allow integration with entity translation.
parent
832d9734
No related branches found
Branches containing commit
Tags
8.x-1.0-beta3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pathauto.module
+25
-11
25 additions, 11 deletions
pathauto.module
with
25 additions
and
11 deletions
pathauto.module
+
25
−
11
View file @
ac0355e1
...
...
@@ -455,15 +455,18 @@ function pathauto_node_update_alias(stdClass $node, $op, array $options = array(
return
;
}
$options
+=
array
(
'language'
=>
isset
(
$node
->
language
)
?
$node
->
language
:
LANGUAGE_NONE
,
);
// Skip processing if the node has no pattern.
$language
=
isset
(
$node
->
language
)
?
$node
->
language
:
LANGUAGE_NONE
;
if
(
!
pathauto_pattern_load_by_entity
(
'node'
,
$node
->
type
,
$language
))
{
if
(
!
pathauto_pattern_load_by_entity
(
'node'
,
$node
->
type
,
$options
[
'language'
]))
{
return
;
}
module_load_include
(
'inc'
,
'pathauto'
);
$uri
=
entity_uri
(
'node'
,
$node
);
pathauto_create_alias
(
'node'
,
$op
,
$uri
[
'path'
],
array
(
'node'
=>
$node
),
$node
->
type
,
$language
);
pathauto_create_alias
(
'node'
,
$op
,
$uri
[
'path'
],
array
(
'node'
=>
$node
),
$node
->
type
,
$
options
[
'
language
'
]
);
}
/**
...
...
@@ -547,7 +550,10 @@ function pathauto_taxonomy_term_update_alias(stdClass $term, $op, array $options
return
;
}
$options
+=
array
(
'alias children'
=>
FALSE
);
$options
+=
array
(
'alias children'
=>
FALSE
,
'language'
=>
isset
(
$term
->
language
)
?
$term
->
language
:
LANGUAGE_NONE
,
);
$module
=
'taxonomy_term'
;
if
(
$term
->
vid
==
variable_get
(
'forum_nav_vocabulary'
,
''
))
{
...
...
@@ -572,11 +578,12 @@ function pathauto_taxonomy_term_update_alias(stdClass $term, $op, array $options
module_load_include
(
'inc'
,
'pathauto'
);
$uri
=
entity_uri
(
'taxonomy_term'
,
$term
);
pathauto_create_alias
(
$module
,
$op
,
$uri
[
'path'
],
array
(
'term'
=>
$term
),
$term
->
vocabulary_machine_name
);
pathauto_create_alias
(
$module
,
$op
,
$uri
[
'path'
],
array
(
'term'
=>
$term
),
$term
->
vocabulary_machine_name
,
$options
[
'language'
]
);
if
(
!
empty
(
$options
[
'alias children'
]))
{
// For all children generate new alias.
// For all children generate new alias
es
.
$options
[
'alias children'
]
=
FALSE
;
unset
(
$options
[
'language'
]);
foreach
(
taxonomy_get_tree
(
$term
->
vid
,
$term
->
tid
)
as
$subterm
)
{
pathauto_taxonomy_term_update_alias
(
$subterm
,
$op
,
$options
);
}
...
...
@@ -667,20 +674,23 @@ function pathauto_user_update_alias(stdClass $account, $op, array $options = arr
return
;
}
$options
+=
array
(
'alias blog'
=>
module_exists
(
'blog'
));
$options
+=
array
(
'alias blog'
=>
module_exists
(
'blog'
),
'language'
=>
LANGUAGE_NONE
,
);
// Skip processing if the account has no pattern.
if
(
!
pathauto_pattern_load_by_entity
(
'user'
))
{
if
(
!
pathauto_pattern_load_by_entity
(
'user'
,
''
,
$options
[
'language'
]
))
{
return
;
}
module_load_include
(
'inc'
,
'pathauto'
);
$uri
=
entity_uri
(
'user'
,
$account
);
pathauto_create_alias
(
'user'
,
$op
,
$uri
[
'path'
],
array
(
'user'
=>
$account
));
pathauto_create_alias
(
'user'
,
$op
,
$uri
[
'path'
],
array
(
'user'
=>
$account
)
,
NULL
,
$options
[
'language'
]
);
// Because blogs are also associated with users, also generate the blog paths.
if
(
!
empty
(
$options
[
'alias blog'
]))
{
pathauto_blog_update_alias
(
$account
,
$op
);
pathauto_blog_update_alias
(
$account
,
$op
,
$options
);
}
}
...
...
@@ -725,9 +735,13 @@ function pathauto_blog_update_alias(stdClass $account, $op, array $options = arr
return
;
}
$options
+=
array
(
'language'
=>
LANGUAGE_NONE
,
);
module_load_include
(
'inc'
,
'pathauto'
);
if
(
node_access
(
'create'
,
'blog'
,
$account
))
{
pathauto_create_alias
(
'blog'
,
$op
,
"blog/
{
$account
->
uid
}
"
,
array
(
'user'
=>
$account
));
pathauto_create_alias
(
'blog'
,
$op
,
"blog/
{
$account
->
uid
}
"
,
array
(
'user'
=>
$account
)
,
NULL
,
$options
[
'language'
]
);
}
else
{
pathauto_path_delete_all
(
"blog/
{
$account
->
uid
}
"
);
...
...
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