Skip to content

Commit

Permalink
Fixed issue #17112: Uploading files at quick translation feature usin…
Browse files Browse the repository at this point in the history
…g integrated editor fails with permission error
  • Loading branch information
olleharstedt committed Apr 20, 2021
1 parent d5f5899 commit 319edb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions application/controllers/admin/translate.php
Expand Up @@ -30,7 +30,14 @@ public function index($surveyid)
if (!Permission::model()->hasSurveyPermission($surveyid, 'translations', 'read')) {
throw new CHttpException(401, "401 Unauthorized");
}

$oSurvey = Survey::model()->findByPk($surveyid);

//KCFINDER SETTINGS
Yii::app()->session['FileManagerContext'] = "edit:survey:{$oSurvey->sid}";
Yii::app()->loadHelper('admin.htmleditor');
initKcfinder();

$tolang = Yii::app()->getRequest()->getParam('lang');
if (!empty($tolang) && !in_array($tolang, $oSurvey->getAllLanguages())) {
Yii::app()->setFlashMessage(gT("Invalid language"), 'warning');
Expand Down

0 comments on commit 319edb7

Please sign in to comment.