Skip to content
This repository has been archived by the owner on Jan 5, 2018. It is now read-only.

Install path and type definitions. #13

Open
wants to merge 2 commits into
base: 8.x-2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions file_entity.install
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ function file_entity_schema() {
* Implements hook_install().
*/
function file_entity_install() {
$type_storage_definition = \Drupal::entityManager()->getFieldStorageDefinitions('file')['type'];
\Drupal::entityManager()->getStorage('file')->onFieldStorageDefinitionCreate($type_storage_definition);
/** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager */
$entity_field_manager = \Drupal::service('entity_field.manager');
$type_storage_definition = $entity_field_manager->getFieldStorageDefinitions('file')['type'];
\Drupal::entityDefinitionUpdateManager()->installFieldStorageDefinition('type', 'file', 'file_entity', $type_storage_definition);

// Set permissions.
$roles = user_roles();
Expand Down