summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src/Entity/Node.php
diff options
context:
space:
mode:
authoreffulgentsia2015-10-07 12:30:24 -0700
committereffulgentsia2015-10-07 12:30:24 -0700
commit190032b775f7ec6a088c487b3d9a9e5c52c845b4 (patch)
treebac782f66cb850b120c77de611e4111b028f3aa6 /core/modules/node/src/Entity/Node.php
parent1672445a15c83da4c24bca8b0bde0195ffe0d861 (diff)
Issue #2072945 by Berdir, plach, effulgentsia, Schnitzel, andypost, Wim Leers: Remove the $langcode parameter in EntityAccessControllerInterface::access() and friends
Diffstat (limited to 'core/modules/node/src/Entity/Node.php')
-rw-r--r--core/modules/node/src/Entity/Node.php23
1 files changed, 1 insertions, 22 deletions
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index c30fe84..861a0d1 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -181,33 +181,12 @@ class Node extends ContentEntityBase implements NodeInterface {
return \Drupal::entityManager()
->getAccessControlHandler($this->entityTypeId)
- ->access($this, $operation, $this->prepareLangcode(), $account, $return_as_object);
+ ->access($this, $operation, $account, $return_as_object);
}
/**
* {@inheritdoc}
*/
- public function prepareLangcode() {
- $langcode = $this->language()->getId();
- // If the Language module is enabled, try to use the language from content
- // negotiation.
- if (\Drupal::moduleHandler()->moduleExists('language')) {
- // Load languages the node exists in.
- $node_translations = $this->getTranslationLanguages();
- // Load the language from content negotiation.
- $content_negotiation_langcode = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
- // If there is a translation available, use it.
- if (isset($node_translations[$content_negotiation_langcode])) {
- $langcode = $content_negotiation_langcode;
- }
- }
- return $langcode;
- }
-
-
- /**
- * {@inheritdoc}
- */
public function getTitle() {
return $this->get('title')->value;
}