Commit bc20bd54 authored by alexpott's avatar alexpott

Issue #2348547 by tim.plunkett, estoyausente: Fixed CommentViewBuilder should...

Issue #2348547 by tim.plunkett, estoyausente: Fixed CommentViewBuilder should use static where possible, subclassing is currently too painful.
parent 99876e6a
......@@ -132,7 +132,7 @@ public function buildComponents(array &$build, array $entities, array $displays,
$display = $displays[$entity->bundle()];
if ($display->getComponent('links')) {
$callback = '\Drupal\comment\CommentViewBuilder::renderLinks';
$callback = get_class() . '::renderLinks';
$context = array(
'comment_entity_id' => $entity->id(),
'view_mode' => $view_mode,
......@@ -197,7 +197,7 @@ public function buildComponents(array &$build, array $entities, array $displays,
* A renderable array representing the comment links.
*/
public static function renderLinks(array $element, array $context) {
$callback = '\Drupal\comment\CommentViewBuilder::renderLinks';
$callback = get_class() . '::renderLinks';
$placeholder = drupal_render_cache_generate_placeholder($callback, $context);
$links = array(
'#theme' => 'links__comment',
......@@ -209,8 +209,7 @@ public static function renderLinks(array $element, array $context) {
$entity = entity_load('comment', $context['comment_entity_id']);
$commented_entity = entity_load($context['commented_entity_type'], $context['commented_entity_id']);
$links['comment'] = self::buildLinks($entity, $commented_entity);
$links['comment'] = static::buildLinks($entity, $commented_entity);
// Allow other modules to alter the comment links.
$hook_context = array(
'view_mode' => $context['view_mode'],
......
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