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
224
Merge Requests
224
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
4ab17248
Commit
4ab17248
authored
Jul 01, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2292815
by larowlan, joshi.rohit100, andypost: Remove join comments on users table.
parent
41576e12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
24 deletions
+3
-24
core/modules/comment/src/CommentStorage.php
core/modules/comment/src/CommentStorage.php
+0
-24
core/modules/comment/src/Entity/Comment.php
core/modules/comment/src/Entity/Comment.php
+3
-0
No files found.
core/modules/comment/src/CommentStorage.php
View file @
4ab17248
...
...
@@ -58,30 +58,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
);
}
/**
* {@inheritdoc}
*/
protected
function
buildQuery
(
$ids
,
$revision_id
=
FALSE
)
{
$query
=
parent
::
buildQuery
(
$ids
,
$revision_id
);
// Specify additional fields from the user table.
$query
->
innerJoin
(
'users'
,
'u'
,
'base.uid = u.uid'
);
// @todo: Move to a computed 'name' field instead.
$query
->
addField
(
'u'
,
'name'
,
'registered_name'
);
return
$query
;
}
/**
* {@inheritdoc}
*/
protected
function
mapFromStorageRecords
(
array
$records
)
{
// Prepare standard comment fields.
foreach
(
$records
as
$record
)
{
$record
->
name
=
$record
->
uid
?
$record
->
registered_name
:
$record
->
name
;
}
return
parent
::
mapFromStorageRecords
(
$records
);
}
/**
* {@inheritdoc}
*/
...
...
core/modules/comment/src/Entity/Comment.php
View file @
4ab17248
...
...
@@ -376,6 +376,9 @@ public function setSubject($subject) {
* {@inheritdoc}
*/
public
function
getAuthorName
()
{
if
(
$this
->
get
(
'uid'
)
->
target_id
)
{
return
$this
->
get
(
'uid'
)
->
entity
->
label
();
}
return
$this
->
get
(
'name'
)
->
value
?:
\
Drupal
::
config
(
'user.settings'
)
->
get
(
'anonymous'
);
}
...
...
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