X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fnode%2Fnode.install;fp=web%2Fcore%2Fmodules%2Fnode%2Fnode.install;h=9b0cda8e56777fd4731613fc12f85334340a743e;hp=4e2c24098e4ec45540b3ec773a62d48e89d6471a;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/node/node.install b/web/core/modules/node/node.install index 4e2c24098..9b0cda8e5 100644 --- a/web/core/modules/node/node.install +++ b/web/core/modules/node/node.install @@ -74,7 +74,7 @@ function node_schema() { 'default' => 0, ], 'realm' => [ - 'description' => 'The realm in which the user must possess the grant ID. Each node access node can define one or more realms.', + 'description' => 'The realm in which the user must possess the grant ID. Modules can define one or more realms by implementing hook_node_grants().', 'type' => 'varchar_ascii', 'length' => 255, 'not null' => TRUE, @@ -246,3 +246,24 @@ function node_update_8301() { $entity_type->set('entity_keys', $keys); $definition_update_manager->updateEntityType($entity_type); } + +/** + * Fix realm column description on the node_access table. + */ +function node_update_8400() { + $schema = drupal_get_module_schema('node', 'node_access'); + $schema['fields']['realm']['description'] = 'The realm in which the user must possess the grant ID. Modules can define one or more realms by implementing hook_node_grants().'; + Database::getConnection()->schema()->changeField('node_access', 'realm', 'realm', $schema['fields']['realm']); +} + +/** + * Run a node access rebuild, if required. + */ +function node_update_8401() { + // Get the list of node access modules. + $modules = \Drupal::moduleHandler()->getImplementations('node_grants'); + // If multilingual usage, then rebuild node access. + if (count($modules) > 0 && \Drupal::languageManager()->isMultilingual()) { + node_access_needs_rebuild(TRUE); + } +}