- π¦πΊAustralia acbramley
node_access() no longer exists, it was removed in #1947880: Replace node_access() by $entity->access() β at which point it seems like all the logic was in the access control handler already.
Follow up for #1658846-199: Add language support to node access grants and records β
Logic in the wrong class.
Move into NodeAccessController
+++ b/core/modules/node/node.module
@@ -2522,6 +2522,18 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) {
+ // If the Language module is enabled, try to use the language from
+ // content negotiation.
+ if (module_exists('language')) {
+ // Load languages the node exists in.
+ $node_translations = $node->getTranslationLanguages();
+ // Load the language from content negotiation.
+ $content_negotiation_langcode = language(LANGUAGE_TYPE_CONTENT)->langcode;
+ // If there is a translation available, use it.
+ if (isset($node_translations[$content_negotiation_langcode])) {
+ $langcode = $content_negotiation_langcode;
+ }
+ }
TBD
No UI changes.
TBD.
Posted by effulgentsia on March 22, 2013 at 7:06pm
+++ b/core/modules/node/node.module
@@ -2522,6 +2522,18 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) {
+ // If the Language module is enabled, try to use the language from
+ // content negotiation.
+ if (module_exists('language')) {
+ // Load languages the node exists in.
+ $node_translations = $node->getTranslationLanguages();
+ // Load the language from content negotiation.
+ $content_negotiation_langcode = language(LANGUAGE_TYPE_CONTENT)->langcode;
+ // If there is a translation available, use it.
+ if (isset($node_translations[$content_negotiation_langcode])) {
+ $langcode = $content_negotiation_langcode;
+ }
+ }
This logic probably should be moved into NodeAccessController, but didn't do so in #198 in order to keep that a straight reroll. I think that can be follow up material though, unless someone is inspired to do it here.
Closed: outdated
11.0 π₯
node system
(Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
node_access() no longer exists, it was removed in #1947880: Replace node_access() by $entity->access() β at which point it seems like all the logic was in the access control handler already.