Skip to content

Commit

Permalink
Dev: minor fixes to avoid breaking on failing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Oct 2, 2018
1 parent 21a8b06 commit 8661693
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions application/controllers/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ public function run()
$lastsurvey = getGlobalSetting($setting_entry);
$survey = Survey::model()->findByPk($lastsurvey);
if ($lastsurvey != null && $survey) {
try {
$aData['showLastSurvey'] = true;
$iSurveyID = $lastsurvey;
$aData['surveyTitle'] = $survey->currentLanguageSettings->surveyls_title." (".gT("ID").":".$iSurveyID.")";
$aData['surveyUrl'] = $this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}");
} catch(Exception $e){
$aData['showLastSurvey'] = false;
}
} else {
$aData['showLastSurvey'] = false;
}
Expand Down
4 changes: 3 additions & 1 deletion application/models/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,10 @@ public function getCurrentLanguageSettings()
{
if (isset($this->languagesettings[App()->language])) {
return $this->languagesettings[App()->language];
} else {
} else if(isset($this->languagesettings[$this->language])){
return $this->languagesettings[$this->language];
} else {
throw new Exception('Selected Surveys language not found');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @var $vtip
*/
?>
<?php if ($hideTip === false){ ?>
<?php if (isset($hideTip) && $hideTip === false){ ?>
<div id='<?php echo $coreId; ?>' class='ls-question-message <?php echo $coreClass; ?>'>
<span class='fa fa-exclamation-circle' aria-hidden="true"></span>
<?php echo $vtip; ?>
Expand Down

0 comments on commit 8661693

Please sign in to comment.