diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index b438821..3dac85f 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -234,12 +234,12 @@ function hook_node_grants($account, $op) { * - 'grant_delete': If set to 1 a user that has been identified as a member * of this gid within this realm can delete this node. * - 'langcode': Optional key. The language code of the grant version. This - * value is set automatically from the $node parameter during the database - * writing. + * value is set automatically from the $node parameter during database + * storage. * * - * When an implementation is interested in a node but want to deny access to - * everyone in Catalan language, it may return a "deny all" grant: + * When an implementation is interested in a node in Catalan language, but want + * to deny access to everyone, it may return a "deny all" grant: * * @code * $grants[] = array( diff --git a/core/modules/node/node.module b/core/modules/node/node.module index f271b68..68fcbfc 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -3404,12 +3404,12 @@ function node_access_acquire_grants(Node $node, $delete = TRUE) { * * @param Drupal\node\Node $node * The $node being written to. All that is necessary is that it contains a - * nid. If it contains langcode - and grant doesn't contain it - this will - * written to databse, else an empty string. + * nid. * @param $grants * A list of grants to write. Each grant is an array that must contain the * following keys: realm, gid, grant_view, grant_update, grant_delete and - * langcode is an optional key which set automatically from $node parameter. + * langcode is an optional key which is set automatically from $node + * parameter. * The realm is specified by a particular module; the gid is as well, and * is a module-defined id to define grant privileges. each grant_* field * is a boolean value. @@ -3440,7 +3440,7 @@ function _node_access_write_grants(Node $node, $grants, $realm = NULL, $delete = if ($grant['grant_view'] || $grant['grant_update'] || $grant['grant_delete']) { $grant['nid'] = $node->nid; if (!isset($grant['langcode'])) { - $grant['langcode'] = isset($node->langcode) ? $node->langcode : ''; + $grant['langcode'] = $node->langcode; } $query->values($grant); }