Skip to content

Commit

Permalink
Fixed issue #13136: can't remove end URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jan 8, 2018
1 parent 19243cf commit 42d9cd8
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions application/controllers/admin/database.php
Expand Up @@ -822,52 +822,53 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID)
if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'update')) {
foreach ($languagelist as $langname) {
if ($langname) {
$sURLDescription = html_entity_decode(Yii::app()->request->getPost('urldescrip_'.$langname), ENT_QUOTES, "UTF-8");
$sURL = html_entity_decode(Yii::app()->request->getPost('url_'.$langname), ENT_QUOTES, "UTF-8");
$data = array();

// Fix bug with FCKEditor saving strange BR types
$short_title = Yii::app()->request->getPost('short_title_'.$langname);
$description = Yii::app()->request->getPost('description_'.$langname);
$welcome = Yii::app()->request->getPost('welcome_'.$langname);
$endtext = Yii::app()->request->getPost('endtext_'.$langname);

$short_title = $this->oFixCKeditor->fixCKeditor($short_title);
$description = $this->oFixCKeditor->fixCKeditor($description);
$welcome = $this->oFixCKeditor->fixCKeditor($welcome);
$endtext = $this->oFixCKeditor->fixCKeditor($endtext);
$dateformat = Yii::app()->request->getPost('dateformat_'.$langname);
$numberformat = Yii::app()->request->getPost('numberformat_'.$langname);

if (!empty($short_title)) {
$sURLDescription = Yii::app()->request->getPost('urldescrip_'.$langname, NULL);
$sURL = Yii::app()->request->getPost('url_'.$langname, NULL);
$short_title = Yii::app()->request->getPost('short_title_'.$langname, NULL);
$description = Yii::app()->request->getPost('description_'.$langname, NULL);
$welcome = Yii::app()->request->getPost('welcome_'.$langname, NULL);
$endtext = Yii::app()->request->getPost('endtext_'.$langname, NULL);
$dateformat = Yii::app()->request->getPost('dateformat_'.$langname, NULL);
$numberformat = Yii::app()->request->getPost('numberformat_'.$langname, NULL);

if ($short_title !== NULL) {
// Fix bug with FCKEditor saving strange BR types
$short_title = $this->oFixCKeditor->fixCKeditor($short_title);
$data['surveyls_title'] = $short_title;
}
if (!empty($description)) {
if ($description !== NULL) {
// Fix bug with FCKEditor saving strange BR types
$description = $this->oFixCKeditor->fixCKeditor($description);
$data['surveyls_description'] = $description;
}
if (!empty($welcome)) {
if ($welcome !== NULL) {
// Fix bug with FCKEditor saving strange BR types
$welcome = $this->oFixCKeditor->fixCKeditor($welcome);
$data['surveyls_welcometext'] = $welcome;
}
if (!empty($endtext)) {
if ($endtext !== NULL) {
// Fix bug with FCKEditor saving strange BR types
$endtext = $this->oFixCKeditor->fixCKeditor($endtext);
$data['surveyls_endtext'] = $endtext;
}
if (!empty($sURL)) {
$data['surveyls_url'] = $sURL;
if ($sURL !== NULL) {
$data['surveyls_url'] = html_entity_decode($sURL, ENT_QUOTES, "UTF-8");
}
if (!empty($sURLDescription)) {
$data['surveyls_urldescription'] = $sURLDescription;
if ($sURLDescription !== NULL) {
$data['surveyls_urldescription'] = html_entity_decode($sURLDescription, ENT_QUOTES, "UTF-8");
}
if (!empty($dateformat)) {
if ($dateformat !== NULL) {
$data['surveyls_dateformat'] = $dateformat;
}
if (!empty($numberformat)) {
if ($numberformat !== NULL) {
$data['surveyls_numberformat'] = $numberformat;
}

$oSurveyLanguageSetting = SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$langname));
$oSurveyLanguageSetting->setAttributes($data);
$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))) {
if (count($data) > 0) {
$oSurveyLanguageSetting = SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$langname));
$oSurveyLanguageSetting->setAttributes($data);
$oSurveyLanguageSetting->save(); // save the change to database
}
}
}
Expand Down

0 comments on commit 42d9cd8

Please sign in to comment.