Skip to content

Commit

Permalink
Fixed issue : unable to use EM in cron
Browse files Browse the repository at this point in the history
Dev: ls\pluginmanager\LimesurveyApi->EMevaluateExpression API broken
Dev: session is set for CWebApplication only
  • Loading branch information
Shnoulle committed Mar 25, 2017
1 parent 3e51550 commit a24951b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/expressions/em_core_helper.php
Expand Up @@ -77,7 +77,7 @@ function __construct()
* @var string|null $baseLang set the previous language if need to be set
*/
$baseLang=null;
if(Yii::app()->session['adminlang']){
if(Yii::app() instanceof CWebApplication && Yii::app()->session['adminlang']){
$baseLang=Yii::app()->getLanguage();
Yii::app()->setLanguage(Yii::app()->session['adminlang']);
}
Expand Down Expand Up @@ -2496,7 +2496,7 @@ public static function gT($string)
* @var string|null $baseLang set the previous language if need to be set
*/
$baseLang=null;
if(Yii::app()->session['adminlang']){
if(Yii::app() instanceof CWebApplication && Yii::app()->session['adminlang']){
$baseLang=Yii::app()->getLanguage();
Yii::app()->setLanguage(Yii::app()->session['adminlang']);
}
Expand Down

0 comments on commit a24951b

Please sign in to comment.