Commit 4ab17248 authored by catch's avatar catch

Issue #2292815 by larowlan, joshi.rohit100, andypost: Remove join comments on users table.

parent 41576e12
......@@ -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}
*/
......
......@@ -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');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment