From 33feda5d4c0ab76795e8e23d112963e50ec16b3e Mon Sep 17 00:00:00 2001 From: markusfluer Date: Wed, 19 Jul 2017 14:19:14 +0200 Subject: [PATCH] Dev: fixed database setting --- application/controllers/admin/database.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/application/controllers/admin/database.php b/application/controllers/admin/database.php index 41dcbaf2cb2..f9e3f4d29e0 100644 --- a/application/controllers/admin/database.php +++ b/application/controllers/admin/database.php @@ -944,11 +944,6 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID) $dateformat = Yii::app()->request->getPost('dateformat_'.$langname); $numberformat = Yii::app()->request->getPost('numberformat_'.$langname); - - var_dump([ - $short_title,$description,$welcome,$endtext - ]); - if(!empty($short_title)) $data['surveyls_title'] = $short_title; if(!empty($description)) @@ -969,7 +964,7 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID) $oSurveyLanguageSetting= SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$langname)); $oSurveyLanguageSetting->setAttributes($data); $save = false; - $save = $SurveyLanguageSetting->save(); // save the change to database + $save = $oSurveyLanguageSetting->save(); // save the change to database if((!empty($short_title)) || (!empty($description)) || (!empty($welcome)) || (!empty($endtext)) || (!empty($sURL)) || (!empty($sURLDescription)) || (!empty($dateformat)) || (!empty($numberformat))) { @@ -1093,7 +1088,6 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID) $oSurvey->adminemail = $this->_filterEmptyFields($oSurvey,'adminemail'); $oSurvey->bounce_email = $this->_filterEmptyFields($oSurvey,'bounce_email'); - $event = new PluginEvent('beforeSurveySettingsSave'); $event->set('modifiedSurvey', $oSurvey); App()->getPluginManager()->dispatchEvent($event); @@ -1238,7 +1232,7 @@ private function _filterEmptyFields(&$oSurvey, $fieldArrayName, $newValue=null){ switch($options['type']){ case 'yesno': if($newValue != 'Y' || $newValue != 'N') - $newValue = $newValue=='1' ? 'Y' : 'N'; + $newValue = ($newValue=='1' || $newValue==true ) ? 'Y' : 'N'; break; case 'Int' : $newValue = (int) $newValue;