-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvarbase_workflow.install
39 lines (29 loc) · 1.22 KB
/
varbase_workflow.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* @file
* Contains install and update for Varbase Workflow module.
*/
use Vardot\Entity\EntityDefinitionUpdateManager;
use Vardot\Installer\ModuleInstallerFactory;
// Include all helpers and updates.
include_once __DIR__ . '/includes/helpers.inc';
include_once __DIR__ . '/includes/updates.inc';
/**
* Implements hook_install().
*/
function varbase_workflow_install() {
// Processor for install: in varbase_workflow.info.yml file.
ModuleInstallerFactory::installList('varbase_workflow');
// Install optional configs.
ModuleInstallerFactory::importConfigsFromScanedDirectory('varbase_workflow', '/^.*(moderated_content.yml)$/i');
ModuleInstallerFactory::importConfigsFromScanedDirectory('varbase_workflow', '/^.*(settings.yml)$/i');
// Entity updates to clear up any mismatched entity and/or field definitions
// And Fix changes were detected in the entity type and field definitions.
\Drupal::classResolver()
->getInstanceFromDefinition(EntityDefinitionUpdateManager::class)
->applyUpdates();
// Add permissions.
ModuleInstallerFactory::addPermissions('varbase_workflow');
// Auto grant access unpublished for limited applicable entity types.
varbase_workflow__auto_grant_access_unpublished();
}