Commit 8fd35862 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Don't break activation without reloadAnyResponseA

[dev] Move to reloadAnyResponse 4.4 and up
parent 802a49e1
......@@ -3,7 +3,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2021 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 0.2.1
* @version 0.2.2
*
* 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
......@@ -47,26 +47,26 @@ class TextEditOnDemand extends PluginBase
*/
public function beforeActivate()
{
if (empty(\reloadAnyResponse\Utilities::API) || \reloadAnyResponse\Utilities::API < 4.1) {
if (!version_compare(Yii::app()->getConfig('versionnumber'), "3.10", ">=")) {
$this->getEvent()->set(
'success',
false
);
$this->getEvent()->set(
'message',
sprintf($this->translate("You need %s plugin with version %s or up."), 'reloadAnyResponse', 4.1)
sprintf($this->translate("You need LimeSurvey version %s and up."), '3.10')
);
return;
}
if (!version_compare(Yii::app()->getConfig('versionnumber'), "3.10", ">=")) {
if (!Yii::app()->getConfig('reloadAnyResponseApi')) {
$this->getEvent()->set(
'success',
false
);
$this->getEvent()->set(
'message',
sprintf($this->translate("You need LimeSurvey version %s and up."), '3.10')
sprintf($this->translate("You need %s plugin with version %s or up."), 'reloadAnyResponse', 4.4)
);
return;
}
$this->setDb();
}
......@@ -158,8 +158,7 @@ class TextEditOnDemand extends PluginBase
*/
public function setTextEditOnDemand()
{
if (empty(\reloadAnyResponse\Utilities::API) || version_compare(\reloadAnyResponse\Utilities::API,'3.3',"<")) {
$this->log("Unable to use TextEditOnDemand without reloadAnyResponse plugin",'error');
if (!Yii::app()->getConfig('reloadAnyResponseApi')) {
return;
}
if ($this->getEvent()->get('type') != "T") {
......
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