Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
token
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
token
Merge requests
!52
Added check for node id
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Added check for node id
issue/token-3216016:3216016-error-the-node
into
8.x-1.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
Added check for node id
Prashant Chauhan
requested to merge
issue/token-3216016:3216016-error-the-node
into
8.x-1.x
Dec 12, 2023
Overview
0
Commits
1
Pipelines
1
Changes
1
Added check for node id
0
0
Merge request reports
Compare
8.x-1.x
8.x-1.x (HEAD)
and
latest version
latest version
fac387e3
1 commit,
Dec 12, 2023
1 file
+
1
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
token.tokens.inc
+
1
−
1
View file @ e29648c9
Edit in single-file editor
Open in Web IDE
Show full file
@@ -569,7 +569,7 @@ function token_tokens($type, array $tokens, array $data, array $options, Bubblea
if
((
$node_type_tokens
=
\Drupal
::
token
()
->
findWithPrefix
(
$tokens
,
'content-type'
))
&&
$node_type
=
NodeType
::
load
(
$node
->
bundle
()))
{
$replacements
+=
\Drupal
::
token
()
->
generate
(
'content-type'
,
$node_type_tokens
,
[
'node_type'
=>
$node_type
],
$options
,
$bubbleable_metadata
);
}
if
((
$url_tokens
=
\Drupal
::
token
()
->
findWithPrefix
(
$tokens
,
'url'
)))
{
if
((
$url_tokens
=
\Drupal
::
token
()
->
findWithPrefix
(
$tokens
,
'url'
))
&&
$node
->
id
()
!==
NULL
)
{
$replacements
+=
\Drupal
::
token
()
->
generate
(
'url'
,
$url_tokens
,
[
'url'
=>
$node
->
toUrl
()],
$options
,
$bubbleable_metadata
);
}
}
Loading