diff core/modules/node/node.install @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 7a779792577d
children
line wrap: on
line diff
--- a/core/modules/node/node.install	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/node/node.install	Thu May 09 15:33:08 2019 +0100
@@ -5,6 +5,7 @@
  * Install, update and uninstall functions for the node module.
  */
 
+use Drupal\Core\Url;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\user\RoleInterface;
@@ -30,7 +31,7 @@
       'title' => t('Node Access Permissions'),
       'value' => $value,
       'description' => t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Rebuilding will remove all privileges to content and replace them with permissions based on the current modules and settings. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions. <a href=":rebuild">Rebuild permissions</a>', [
-        ':rebuild' => \Drupal::url('node.configure_rebuild_confirm'),
+        ':rebuild' => Url::fromRoute('node.configure_rebuild_confirm')->toString(),
       ]),
     ];
   }
@@ -134,7 +135,7 @@
   }
 
   // Populate the node access table.
-  db_insert('node_access')
+  Database::getConnection()->insert('node_access')
     ->fields([
       'nid' => 0,
       'gid' => 0,
@@ -267,3 +268,16 @@
     node_access_needs_rebuild(TRUE);
   }
 }
+
+/**
+ * Set the 'owner' entity key and update the field.
+ */
+function node_update_8700() {
+  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
+  $entity_type = $definition_update_manager->getEntityType('node');
+  $keys = $entity_type->getKeys();
+  $keys['owner'] = 'uid';
+  $entity_type->set('entity_keys', $keys);
+  $definition_update_manager->updateEntityType($entity_type);
+  $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'node'));
+}