summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-10-09 09:48:19 (GMT)
committerAlex Pott2014-10-09 09:48:19 (GMT)
commit16883210eb291bbe7e73dd344e549e58e9d76946 (patch)
tree827d94e6738f123d1da8af345cfd804f3cdfdf06
parentd96918cc0d408a54df7cf0ffd21e56b49d70774b (diff)
Issue #2342683 by David Hernández, dawehner: Fixed NodeViewBuilder should use static where possible, subclassing is currently too painful.
-rw-r--r--core/modules/node/src/NodeViewBuilder.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/node/src/NodeViewBuilder.php b/core/modules/node/src/NodeViewBuilder.php
index 1136428..5f82472 100644
--- a/core/modules/node/src/NodeViewBuilder.php
+++ b/core/modules/node/src/NodeViewBuilder.php
@@ -35,7 +35,7 @@ class NodeViewBuilder extends EntityViewBuilder {
$display = $displays[$bundle];
if ($display->getComponent('links')) {
- $callback = '\Drupal\node\NodeViewBuilder::renderLinks';
+ $callback = get_called_class() . '::renderLinks';
$context = array(
'node_entity_id' => $entity->id(),
'view_mode' => $view_mode,
@@ -98,7 +98,7 @@ class NodeViewBuilder extends EntityViewBuilder {
* A renderable array representing the node links.
*/
public static function renderLinks(array $element, array $context) {
- $callback = '\Drupal\node\NodeViewBuilder::renderLinks';
+ $callback = get_called_class() . '::renderLinks';
$placeholder = drupal_render_cache_generate_placeholder($callback, $context);
$links = array(
@@ -109,7 +109,7 @@ class NodeViewBuilder extends EntityViewBuilder {
if (!$context['in_preview']) {
$entity = entity_load('node', $context['node_entity_id'])->getTranslation($context['langcode']);
- $links['node'] = self::buildLinks($entity, $context['view_mode']);
+ $links['node'] = static::buildLinks($entity, $context['view_mode']);
// Allow other modules to alter the node links.
$hook_context = array(