Commit d30b110c authored by Chenu Denis's avatar Chenu Denis

[fix] Don't throw error if surveyid is not set in params

parent 5b0b8f11
......@@ -7,7 +7,7 @@
* @copyright 2014-2018 Denis Chenu <http://sondages.pro>
* @copyright 2014-2018 Belgian Health Care Knowledge Centre (KCE) <http://kce.fgov.be>
* @license AGPL v3
* @version 1.0.0
* @version 1.0.1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
......@@ -37,11 +37,13 @@ class exportInitiative extends PluginBase {
{
$event = $this->getEvent();
$type = $event->get('type');
$sid = Yii::app()->getRequest()->getParam('surveyid');
$oSettingMenuSurvey = PluginSetting::model()->find(Yii::app()->db->quoteColumnName("key")." = :setting and model_id = :sid",array(":setting"=>'menuSurvey',":sid"=>$sid));
$MenuSurvey = json_decode($oSettingMenuSurvey->value);
if(!$MenuSurvey){
return;
$sid = Yii::app()->getRequest()->getParam('surveyid',Yii::app()->getRequest()->getParam('surveyId'));
if(!empty($sid)) { // If no current sid : show it in other list
$oSettingMenuSurvey = PluginSetting::model()->find(Yii::app()->db->quoteColumnName("key")." = :setting and model_id = :sid",array(":setting"=>'menuSurvey',":sid"=>$sid));
$MenuSurvey = json_decode($oSettingMenuSurvey->value);
if(!$MenuSurvey){
return;
}
}
switch ($type) {
case 'initiative':
......@@ -73,4 +75,5 @@ class exportInitiative extends PluginBase {
}
$event->set('writer', $writer);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment