diff --git a/lizmap/modules/lizmap/classes/lizmapServices.class.php b/lizmap/modules/lizmap/classes/lizmapServices.class.php index 4b157a0426..2c22bd1950 100644 --- a/lizmap/modules/lizmap/classes/lizmapServices.class.php +++ b/lizmap/modules/lizmap/classes/lizmapServices.class.php @@ -437,8 +437,12 @@ public function saveIntoIni($ini, $liveIni) $liveIni->setValue($key, $this->{$prop}, $section); } elseif ($this->{$prop} != '') { $ini->setValue($prop, $this->{$prop}, 'services'); - if ($prop == 'adminContactEmail' && $this->globalConfig->lizmap['setAdminContactEmailAsReplyTo']) { - $liveIni->setValue('replyTo', $this->{$prop}, 'mailer'); + if ($prop == 'adminContactEmail') { + if ($this->globalConfig->lizmap['setAdminContactEmailAsReplyTo']) { + $liveIni->setValue('replyTo', $this->{$prop}, 'mailer'); + } + // for jCommunity 1.4+ + $liveIni->setValue('notificationReceiverEmail', $this->{$prop}, 'jcommunity'); } } else { $ini->removeValue($prop, 'services'); diff --git a/lizmap/modules/lizmap/install/upgrade_commconfig.php b/lizmap/modules/lizmap/install/upgrade_commconfig.php new file mode 100644 index 0000000000..01c98bf1dd --- /dev/null +++ b/lizmap/modules/lizmap/install/upgrade_commconfig.php @@ -0,0 +1,26 @@ +getValue('notificationReceiverEmail', 'jcommunity'); + if (!$currentValue) { + $lizmapConfFile = jApp::varConfigPath('lizmapConfig.ini.php'); + $ini = new \Jelix\IniFile\IniModifier($lizmapConfFile); + $contact = $ini->getValue('adminContactEmail', 'services'); + $liveIni->setValue('notificationReceiverEmail', $contact, 'jcommunity'); + $liveIni->save(); + } + } +}