Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
4ab17248
Commit
4ab17248
authored
Jul 01, 2014
by
catch
Browse files
Issue
#2292815
by larowlan, joshi.rohit100, andypost: Remove join comments on users table.
parent
41576e12
Changes
2
Hide whitespace changes
Inline
Side-by-side
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