Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
311
Merge Requests
311
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d5c96218
Commit
d5c96218
authored
Apr 23, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2141523
by effulgentsia, tim.plunkett: Comment's comment.bundle route contains unused code.
parent
9826e247
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
62 deletions
+1
-62
core/modules/comment/comment.routing.yml
core/modules/comment/comment.routing.yml
+1
-3
core/modules/comment/lib/Drupal/comment/Controller/AdminController.php
...comment/lib/Drupal/comment/Controller/AdminController.php
+0
-59
No files found.
core/modules/comment/comment.routing.yml
View file @
d5c96218
...
...
@@ -74,11 +74,9 @@ comment.bundle_list:
requirements
:
_permission
:
'
administer
comments'
# This route is only used by Field UI.
comment.bundle
:
path
:
'
/admin/structure/comments/manage/{bundle}'
defaults
:
_content
:
'
Drupal\comment\Controller\AdminController::bundleInfo'
_title_callback
:
'
Drupal\comment\Controller\AdminController::bundleTitle'
requirements
:
_access
:
'
FALSE'
...
...
core/modules/comment/lib/Drupal/comment/Controller/AdminController.php
View file @
d5c96218
...
...
@@ -184,65 +184,6 @@ public function overviewBundles() {
return
$build
;
}
/**
* Returns an overview of the entity types a comment field is attached to.
*
* @param string $commented_entity_type
* The entity type to which the comment field is attached.
* @param string $field_name
* The comment field for which the overview is to be displayed.
*
* @return array
* A renderable array containing the list of entity types and bundle
* combinations on which the comment field is in use.
*/
public
function
bundleInfo
(
$commented_entity_type
,
$field_name
)
{
// Add a link to manage entity fields if the Field UI module is enabled.
$field_ui_enabled
=
$this
->
moduleHandler
()
->
moduleExists
(
'field_ui'
);
$field_info
=
$this
->
fieldInfo
->
getField
(
$commented_entity_type
,
$field_name
);
$entity_type_info
=
$this
->
entityManager
()
->
getDefinition
(
$commented_entity_type
);
$entity_bundle_info
=
$this
->
entityManager
()
->
getBundleInfo
(
$commented_entity_type
);
$build
[
'usage'
]
=
array
(
'#theme'
=>
'item_list'
,
'#title'
=>
String
::
checkPlain
(
$entity_type_info
->
getLabel
()),
'#items'
=>
array
(),
);
// Loop over all of bundles to which this comment field is attached.
foreach
(
$field_info
->
getBundles
()
as
$bundle
)
{
// Add the current instance to the list of bundles.
if
(
$field_ui_enabled
&&
$route_info
=
FieldUI
::
getOverviewRouteInfo
(
$commented_entity_type
,
$bundle
))
{
// Add a link to configure the fields on the given bundle and entity
// type combination.
$build
[
'usage'
][
'#items'
][]
=
$this
->
l
(
$entity_bundle_info
[
$bundle
][
'label'
],
$route_info
[
'route_name'
],
$route_info
[
'route_parameters'
]);
}
else
{
// Field UI is disabled so fallback to a list of bundle labels
// instead of links to configure fields.
$build
[
'usage'
][
'#items'
][]
=
String
::
checkPlain
(
$entity_bundle_info
[
$bundle
][
'label'
]);
}
}
return
$build
;
}
/**
* Route title callback.
*
* @param string $commented_entity_type
* The entity type to which the comment field is attached.
* @param string $field_name
* The comment field for which the overview is to be displayed.
*
* @return string
* The human readable field name.
*/
public
function
bundleTitle
(
$commented_entity_type
,
$field_name
)
{
return
$this
->
commentManager
->
getFieldUIPageTitle
(
$commented_entity_type
,
$field_name
);
}
/**
* Presents an administrative comment listing.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment