Enforce entity reference integrity on plan reference fields.
This commit is contained in:
parent
4f4f666c28
commit
8d25b32b01
|
@ -16,6 +16,7 @@ function farm_entity_install() {
|
||||||
'data_stream',
|
'data_stream',
|
||||||
'file',
|
'file',
|
||||||
'log',
|
'log',
|
||||||
|
'plan',
|
||||||
'quantity',
|
'quantity',
|
||||||
'taxonomy_term',
|
'taxonomy_term',
|
||||||
'user',
|
'user',
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Post update hooks for the farm_entity module.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enforce entity reference integrity on plan reference fields.
|
||||||
|
*/
|
||||||
|
function farm_entity_post_update_enforce_plan_eri(&$sandbox) {
|
||||||
|
$config = \Drupal::configFactory()->getEditable('entity_reference_integrity_enforce.settings');
|
||||||
|
$entity_types = $config->get('enabled_entity_type_ids');
|
||||||
|
$entity_types['plan'] = 'plan';
|
||||||
|
$config->set('enabled_entity_type_ids', $entity_types);
|
||||||
|
$config->save();
|
||||||
|
}
|
Loading…
Reference in New Issue