From a65655783821a4148feab3f9e46f307203c69635 Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Wed, 26 Oct 2016 19:20:37 -0400 Subject: [PATCH] Enable farm_asset_children module, and ensure that farm_update_7019() runs before farm_livestock_update_7001(). --- farm.install | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/farm.install b/farm.install index c794da2c4..af0e1a8df 100644 --- a/farm.install +++ b/farm.install @@ -170,6 +170,11 @@ function farm_update_dependencies() { ); $dependencies['farm_equipment'][7000] = $farm_7000; $dependencies['farm_livestock'][7000] = $farm_7000; + + // farm_livestock_7001() depends on farm_update_7019() because it uses the new + // field_farm_parent field from the farm_asset_children module. + $dependencies['farm_livestock'][7001] = array('farm' => 7019); + return $dependencies; } @@ -464,6 +469,26 @@ function farm_update_7018(&$sandbox) { drupal_uninstall_modules($modules); } +/** + * Install Farm Asset Children module. + */ +function farm_update_7019(&$sandbox) { + + // Enable the Farm Asset Children module. + _farm_update_enable_modules(array('farm_asset_children')); + + // Reset the "default_hook" static cache for field_base Features components. + module_load_include('inc', 'features', 'features.export'); + features_get_default_hooks('field_base', TRUE); + + // Load the farm_asset_children field_base Features include file, otherwise + // feature_get_default() will not see it, and the revert will fail. + module_load_include('inc', 'farm_asset_children', 'farm_asset_children.features.field_base'); + + // Revert the field_base component of farm_asset_children. + features_revert(array('farm_asset_children' => array('field_base'))); +} + /** * Update helper function: enable modules. */