Browse Source

Fixing install file

logicp 8 years ago
parent
commit
eb51d418bb
1 changed files with 2 additions and 105 deletions
  1. 2 105
      heartbeat8.install

+ 2 - 105
heartbeat8.install

@@ -197,6 +197,7 @@ function heartbeat8_schema() {
         'size' => 'big',
         'description' => 'Indicates whether the activity is related to a group',
         'default' => 0,
+      ),
     ),
     'primary key' => array('uaid'),
     'indexes' => array(
@@ -209,7 +210,7 @@ function heartbeat8_schema() {
       'cid' => array('cid'),
       'language' => array('language'),
       ),
-    ),
+
   );
 
   $schema['heartbeat_activity']['fields']['in_group'] = array(
@@ -350,107 +351,3 @@ function heartbeat_install_table_user_templates() {
     ),
   );
 }
-
-/**
- * Implements hook_install().
- */
-function heartbeat8_install() {
-  // Enable default permissions for system roles.
-  // IMPORTANT: Modules SHOULD NOT automatically grant any user role access
-  // permissions in hook_install().
-  // However, the 'access content' permission is a very special case, since
-  // there is hardly a point in installing the Node module without granting
-  // these permissions. Doing so also allows tests to continue to operate as
-  // expected without first having to manually grant these default permissions.
-  if (\Drupal::moduleHandler()->moduleExists('user')) {
-    user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access content'));
-    user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access content'));
-  }
-
-  // Populate the node access table.
-  db_insert('node_access')
-    ->fields(array(
-      'nid' => 0,
-      'gid' => 0,
-      'realm' => 'all',
-      'grant_view' => 1,
-      'grant_update' => 0,
-      'grant_delete' => 0,
-    ))
-    ->execute();
-}
-
-/**
- * Implements hook_uninstall().
- */
-function heartbeat8_uninstall() {
-  // Delete remaining general module variables.
-  \Drupal::state()->delete('node.node_access_needs_rebuild');
-}
-
-/**
- * Add 'revision_translation_affected' field to 'node' entities.
- */
-function heartbeat8_update_8001() {
-  // Install the definition that this field had in
-  // \Drupal\node\Entity\Node::baseFieldDefinitions()
-  // at the time that this update function was written. If/when code is
-  // deployed that changes that definition, the corresponding module must
-  // implement an update function that invokes
-  // \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition()
-  // with the new definition.
-  $storage_definition = BaseFieldDefinition::create('boolean')
-    ->setLabel(t('Revision translation affected'))
-    ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
-    ->setReadOnly(TRUE)
-    ->setRevisionable(TRUE)
-    ->setTranslatable(TRUE);
-
-  \Drupal::entityDefinitionUpdateManager()
-    ->installFieldStorageDefinition('revision_translation_affected', 'node', 'node', $storage_definition);
-}
-
-/**
- * Remove obsolete indexes from the node schema.
- */
-function heartbeat8_update_8002() {
-  // The "node__default_langcode" and "node_field__langcode" indexes were
-  // removed from \Drupal\node\NodeStorageSchema in
-  // https://www.drupal.org/node/2261669, but this update function wasn't
-  // added until https://www.drupal.org/node/2542748. Regenerate the related
-  // schemas to ensure they match the currently expected status.
-  $manager = \Drupal::entityDefinitionUpdateManager();
-  // Regenerate entity type indexes, this should drop "node__default_langcode".
-  $manager->updateEntityType($manager->getEntityType('node'));
-  // Regenerate "langcode" indexes, this should drop "node_field__langcode".
-  $manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition('langcode', 'node'));
-}
-
-/**
- * Promote 'status' and 'uid' fields to entity keys.
- */
-function heartbeat8_update_8003() {
-  // The 'status' and 'uid' fields were added to the 'entity_keys' annotation
-  // of \Drupal\node\Entity\Node in https://www.drupal.org/node/2498919, but
-  // this update function wasn't added until
-  // https://www.drupal.org/node/2542748.
-  $manager = \Drupal::entityDefinitionUpdateManager();
-  $entity_type = $manager->getEntityType('node');
-  $entity_keys = $entity_type->getKeys();
-  $entity_keys['status'] = 'status';
-  $entity_keys['uid'] = 'uid';
-  $entity_type->set('entity_keys', $entity_keys);
-  $manager->updateEntityType($entity_type);
-
-  // @todo The above should be enough, since that is the only definition that
-  //   changed. But \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema varies
-  //   field schema by whether a field is an entity key, so invoke
-  //   EntityDefinitionUpdateManagerInterface::updateFieldStorageDefinition()
-  //   with an unmodified field storage definition to trigger the necessary
-  //   changes. SqlContentEntityStorageSchema::onEntityTypeUpdate() should be
-  //   fixed to automatically handle this.
-  //   See https://www.drupal.org/node/2554245.
-  foreach (array('status', 'uid') as $field_name) {
-    $manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition($field_name, 'node'));
-  }
-}