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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!5560
adding <none> to link field when entity does not exist anymore
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
adding <none> to link field when entity does not exist anymore
issue/drupal-3404451:10.1.x
into
10.1.x
Overview
0
Commits
4
Pipelines
4
Changes
2
Open
adding <none> to link field when entity does not exist anymore
Salim Qazizada
requested to merge
issue/drupal-3404451:10.1.x
into
10.1.x
Nov 27, 2023
Overview
0
Commits
4
Pipelines
4
Changes
2
0
0
Merge request reports
Compare
10.1.x
version 3
14be222d
Jan 11, 2024
version 2
19686f43
Jan 11, 2024
version 1
ade404ab
Nov 27, 2023
10.1.x (HEAD)
and
latest version
latest version
04df1a05
4 commits,
Jan 11, 2024
version 3
14be222d
3 commits,
Jan 11, 2024
version 2
19686f43
2 commits,
Jan 11, 2024
version 1
ade404ab
1 commit,
Nov 27, 2023
2 files
+
45
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+
7
−
2
View file @ 9c21cd23
Edit in single-file editor
Open in Web IDE
Show full file
@@ -76,8 +76,13 @@ protected static function getUriAsDisplayableString($uri) {
// Show the 'entity:' URI as the entity autocomplete would.
// @todo Support entity types other than 'node'. Will be fixed in
// https://www.drupal.org/node/2423093.
if
(
$entity_type
==
'node'
&&
$entity
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
$entity_type
)
->
load
(
$entity_id
))
{
$displayable_string
=
EntityAutocomplete
::
getEntityLabels
([
$entity
]);
if
(
$entity_type
==
'node'
)
{
if
(
$entity
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
$entity_type
)
->
load
(
$entity_id
))
{
$displayable_string
=
EntityAutocomplete
::
getEntityLabels
([
$entity
]);
}
else
{
$displayable_string
=
'<none>'
;
}
}
}
elseif
(
$scheme
===
'route'
)
{
Loading