Commit f53705c9 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Throw CDBerror if survey id is not a integer

parent b02073f5
......@@ -4,7 +4,7 @@
* @copyright 2020-2021 Denis Chenu <http://www.sondages.pro>
* @copyright 2020 OECD (Organisation for Economic Co-operation and Development ) <www.oecd.org>
* @license GPL
* @version 0.9.5
* @version 0.9.6
*
* 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
......@@ -23,9 +23,6 @@ class matchDataControl extends PluginBase
protected static $description = 'Match data by specific value.';
protected static $name = 'matchDataControl';
/* private boolean isDone */
private $isDone = false;
public function init()
{
/* Add settings update */
......@@ -86,20 +83,25 @@ class matchDataControl extends PluginBase
if (!$this->getEvent()) {
throw new CHttpException(403);
}
$this->unsubscribe('getPluginTwigPath');
$surveyId = Yii::app()->getRequest()->getQuery('sid', Yii::app()->getRequest()->getParam('surveyid'));
if ($surveyId) {
if(!$this->get('matchQuestion1', 'Survey', $surveyId, null)) {
return;
}
if(!$this->get('matchQuestion2', 'Survey', $surveyId, null)) {
return;
}
if(!$this->get('matchedQuestions', 'Survey', $surveyId, null)) {
return;
}
$this->matchData($surveyId);
if (!$surveyId) {
return;
}
$this->unsubscribe('getPluginTwigPath');
$oSurvey = Survey::model()->findByPk($surveyId);
if(!$oSurvey) {
return;
}
if(!$this->get('matchQuestion1', 'Survey', $surveyId, null)) {
return;
}
if(!$this->get('matchQuestion2', 'Survey', $surveyId, null)) {
return;
}
if(!$this->get('matchedQuestions', 'Survey', $surveyId, null)) {
return;
}
$this->matchData($surveyId);
}
/**
......
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