mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Refactor farm_entity config_rewrite settings into hook_install().
This commit is contained in:
parent
e2d822ac4a
commit
505dc83130
|
@ -1,8 +0,0 @@
|
|||
enabled_entity_type_ids:
|
||||
asset: asset
|
||||
data_stream: data_stream
|
||||
file: file
|
||||
log: log
|
||||
quantity: quantity
|
||||
taxonomy_term: taxonomy_term
|
||||
user: user
|
|
@ -4,7 +4,6 @@ type: module
|
|||
package: farmOS
|
||||
core_version_requirement: ^9
|
||||
dependencies:
|
||||
- config_rewrite:config_rewrite
|
||||
- drupal:file
|
||||
- drupal:geofield
|
||||
- drupal:image
|
||||
|
|
24
modules/core/entity/farm_entity.install
Normal file
24
modules/core/entity/farm_entity.install
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install, update and uninstall functions for the farm_entity module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_install().
|
||||
*/
|
||||
function farm_entity_install() {
|
||||
|
||||
// Enforce entity reference integrity on the entity types we care about.
|
||||
$enforced_entity_types = [
|
||||
'asset',
|
||||
'data_stream',
|
||||
'file',
|
||||
'log',
|
||||
'quantity',
|
||||
'taxonomy_term',
|
||||
'user',
|
||||
];
|
||||
\Drupal::configFactory()->getEditable('entity_reference_integrity_enforce.settings')->set('enabled_entity_type_ids', array_combine($enforced_entity_types, $enforced_entity_types))->save();
|
||||
}
|
Loading…
Reference in a new issue