Fix water module installation, enable it by default on new sites, and enable it on existing sites.

This commit is contained in:
Michael Stenta 2018-12-18 17:31:32 -05:00
parent a3f8958f99
commit 93539d056d
2 changed files with 10 additions and 5 deletions

View File

@ -73,6 +73,7 @@ function farm_install_configure_form($form, &$form_state) {
'farm_area_types' => t('Default area types: Property, Field, Building, etc'),
'farm_crop_area_types' => t('Crop area types: Bed and Greenhouse'),
'farm_livestock_area_types' => t('Livestock area types: Paddock'),
'farm_water' => st('Water area type'),
'farm_access' => st('Default roles: Manager, Worker, Viewer'),
'farm_help' => st('farmOS Help Pages'),
'farm_tour' => st('farmOS Tours'),
@ -80,7 +81,6 @@ function farm_install_configure_form($form, &$form_state) {
);
// Extra modules will not be selected by default.
$extra_modules = array(
'Water' => st('Water area type'),
'farm_water_test' => st('Water test logs'),
'farm_soil_compost' => st('Compost'),
'farm_sensor' => st('Sensor'),

View File

@ -23,11 +23,16 @@ function farm_area_update_7000() {
}
/**
* Install the Farm Area Types module.
* Install the Farm Area Types and Farm Water modules.
*/
function farm_area_update_7001(&$sandbox) {
$module = 'farm_area_types';
if (!module_exists($module)) {
module_enable(array($module));
$modules = array(
'farm_area_types',
'farm_water',
);
foreach ($modules as $module) {
if (!module_exists($module)) {
module_enable(array($module));
}
}
}