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

[fix] check only one time par page if matchQuestionData is set (in case is empty)

parent f53705c9
<?php
/**
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2020-2021 Denis Chenu <http://www.sondages.pro>
* @copyright 2020-2022 Denis Chenu <http://www.sondages.pro>
* @copyright 2020 OECD (Organisation for Economic Co-operation and Development ) <www.oecd.org>
* @license GPL
* @version 0.9.6
* @version 0.9.7
*
* 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
......@@ -792,9 +792,12 @@ class matchDataControl extends PluginBase
if (!$this->getEvent()) {
throw new CHttpException(403);
}
$surveyId = $this->getEvent()->get('surveyId');
if (empty($this->get('matchQuestionData', 'Survey', $surveyId, null))) {
$this->unsubscribe('beforeQuestionRender');
}
$type = $this->getEvent()->get('type');
$code = $this->getEvent()->get('code');
$surveyId = $this->getEvent()->get('surveyId');
if ($code == $this->get('matchQuestionData', 'Survey', $surveyId, null) && in_array($type, ['T','U'])) {
$questionRenderEvent = $this->getEvent();
$answer = $this->_getQuestionAnswerHtml($surveyId, $questionRenderEvent->get('qid'));
......
Supports Markdown
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