Skip to content

Commit

Permalink
Fixed Issue #17026: Custom themes not uploading files (#1733)
Browse files Browse the repository at this point in the history
* Fixed Issue #17026: Custom themes not uploading files

Code for backward compatiblity with custom themes that are expecting to upload images to upload subaction.
That happens as their options.twig are outdated.
Now that the upload subaction doesn't handle all uploads, weneed to dispatch to the proper.

* Fixed Issue #17026: Custom themes not uploading files

Code Review
  • Loading branch information
gabrieljenik committed Feb 4, 2021
1 parent 321bde5 commit bf44b17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions application/controllers/admin/themes.php
Expand Up @@ -172,6 +172,17 @@ public function tmp($id)
*/
public function upload()
{
// Code for backward compatiblity with custom themes that are expecting to upload images to upload subaction.
// That happens as their options.twig are outdated.
// Now that the upload subaction doesn't handle all uploads, weneed to dispatch to the proper.
$action = returnGlobal('action');
if ($action == 'templateuploadimagefile') {
return $this->templateuploadimagefile();
}
if ($action == 'templateupload') {
return $this->templateupload();
}

$sTemplateName = Yii::app()->request->getPost('templatename');
if (Permission::model()->hasGlobalPermission('templates', 'import') || Permission::model()->hasTemplatePermission($sTemplateName)) {
Yii::app()->loadHelper('admin/template');
Expand Down

0 comments on commit bf44b17

Please sign in to comment.