Hi all,
I'm struggling with an issue uploading images inside the CKEditor in the information pages of my OpenCart install.
It's pretty much a clean install, using a custom template for the store front. The installation lives inside a subdirectory (/shop)
I can upload images for the products and categories with no problems, but when I try to upload images in the actual editor, I run into problems.
Everything seems to work OK... I can browse for the file, click on 'Send it to the server' but then it fails. With a bit of testing, it looks like the address field is being replaced by the actual file manager itself (see attached screenshot... although it's difficult to see)
The config for the editor is pointing uploads at the filemanager controller (config.filebrowserUploadUrl = 'index.php?route=common/filemanager';)
Browser choice doesn't seem to make any difference.
Any pointers are greatly appreciated ! I'm on OC version 1.4.9.1 and everything else is working fine...
Thanks in advance !
I'm struggling with an issue uploading images inside the CKEditor in the information pages of my OpenCart install.
It's pretty much a clean install, using a custom template for the store front. The installation lives inside a subdirectory (/shop)
I can upload images for the products and categories with no problems, but when I try to upload images in the actual editor, I run into problems.
Everything seems to work OK... I can browse for the file, click on 'Send it to the server' but then it fails. With a bit of testing, it looks like the address field is being replaced by the actual file manager itself (see attached screenshot... although it's difficult to see)
The config for the editor is pointing uploads at the filemanager controller (config.filebrowserUploadUrl = 'index.php?route=common/filemanager';)
Browser choice doesn't seem to make any difference.
Any pointers are greatly appreciated ! I'm on OC version 1.4.9.1 and everything else is working fine...
Thanks in advance !
Attachments
Upload dialogue issue - upload_issue.png (19.74 KiB) Viewed 4249 times
--
Tim
I haven't been working on that project for a couple of weeks, so I haven't been back to look at it yet to be truthful. In some ways I'm glad it's not just me with the problem, I was starting to think I was going mental. I'll be back on it next week, so if nobody else knows a solution, I'll be looking for one properly then !
Cheers
Cheers
--
Tim
1. modify template files that use CKEditor ( ex: admin/view/template/catalog/product_form.tpl , information_form.tpl ...)
find :
change to :
2. modify function upload() in admin/controller/common/filemanager.php
find :
insert before it
find :
change to :
find :
Code: Select all
filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
Code: Select all
filebrowserUploadUrl: 'index.php?route=common/filemanager/upload&token=<?php echo $token; ?>',
filebrowserImageUploadUrl: 'index.php?route=common/filemanager/upload&token=<?php echo $token; ?>',
filebrowserFlashUploadUrl: 'index.php?route=common/filemanager/upload&token=<?php echo $token; ?>'
find :
Code: Select all
if (isset($this->request->post['directory'])) {
Code: Select all
// set default directory and upload file id for CKEditor
if ( isset($this->request->get['CKEditorFuncNum']) ) {
$this->request->post['directory'] = '';
$this->request->files['image'] = $this->request->files['upload'];
}
Code: Select all
$this->load->library('json');
$this->response->setOutput(Json::encode($json));
Code: Select all
// response for CKEditor
if ( isset($this->request->get['CKEditorFuncNum']) ) {
if ( $json['success'] ) {
echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(".$this->request->get['CKEditorFuncNum'].", '/image/data/".$this->request->files['image']['name']."');</script>";
} else {
echo $json['error'];
}
// normal response for default filemanager
} else {
$this->load->library('json');
$this->response->setOutput(Json::encode($json));
}
Who is online
Users browsing this forum: No registered users and 210 guests