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
Merge requests
!9192
Update link templates of test entities
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Update link templates of test entities
issue/drupal-2699959:2699959-update-link-templates
into
11.x
Overview
0
Commits
6
Pipelines
7
Changes
13
Closed
quietone
requested to merge
issue/drupal-2699959:2699959-update-link-templates
into
11.x
8 months ago
Overview
0
Commits
6
Pipelines
7
Changes
13
Expand
Closes
#2699959
0
0
Merge request reports
Compare
11.x
version 6
f568afbf
5 months ago
version 5
5f5ad46b
6 months ago
version 4
e709aa28
7 months ago
version 3
a1db3e71
8 months ago
version 2
66df5b5b
8 months ago
version 1
11a4a0ca
8 months ago
11.x (base)
and
latest version
latest version
05db1e86
6 commits,
5 months ago
version 6
f568afbf
5 commits,
5 months ago
version 5
5f5ad46b
6 commits,
6 months ago
version 4
e709aa28
4 commits,
7 months ago
version 3
a1db3e71
3 commits,
8 months ago
version 2
66df5b5b
2 commits,
8 months ago
version 1
11a4a0ca
1 commit,
8 months ago
13 files
+
23
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php
+
1
−
5
Options
@@ -154,11 +154,7 @@ protected function getAddFormRoute(EntityTypeInterface $entity_type) {
// If the entity has bundles, we can provide a bundle-specific title
// and access requirements.
$expected_parameter
=
$entity_type
->
getBundleEntityType
()
?:
$entity_type
->
getKey
(
'bundle'
);
// @todo We have to check if a route contains a bundle in its path as
// test entities have inconsistent usage of "add-form" link templates.
// Fix it in https://www.drupal.org/node/2699959.
if
((
$bundle_key
=
$entity_type
->
getKey
(
'bundle'
))
&&
str_contains
(
$route
->
getPath
(),
'{'
.
$expected_parameter
.
'}'
))
{
if
(
$bundle_key
=
$entity_type
->
getKey
(
'bundle'
))
{
$route
->
setDefault
(
'_title_callback'
,
EntityController
::
class
.
'::addBundleTitle'
);
// If the bundles are entities themselves, we can add parameter
// information to the route options.
Loading