Page 3 of 4
Re: Problem with Image Manager
Posted: Wed Jun 29, 2016 4:17 am
by R_D
straightlight wrote:
It indicates in your last response that you would try it but no results were posted afterwards. Would it be possible to post more details about this?
Well, the 'temporary' fix worked, I forgot to give feedback. But there must be a reason why the base URL isn't in the sitemap without that fix...
Re: Problem with Image Manager
Posted: Wed Jun 29, 2016 4:28 am
by IP_CAM
fixed, reworked my test OC 2.2 back to default, tested and works now, as shown here:
http://forum.opencart.com/viewtopic.php ... 20#p626245
Now, the only possible requirement may be, to have valid size tags to images and make large Images size-responsive
by use of the
manually inserted (in Source-Code-View!) class declaration, like:
>> class="img-responsive" <<
to make it look like:
Code: Select all
<img alt="Test Banner" title="Test Banner" width="1234" height="567" class="img-responsive" src="http://whatever.com/oc22/image/catalog/1234x567_banner.jpg">
IMPORTANT: To SAVE such a Product Description Page Change in my OC v.2.2.0.0, I need to
switch back to WysiWyg Modus, to
SAVE the new image settings, or it will not SAVE the
responsive class command,
if saved in in
Source-Code-Editor-Modus!!
Sample Page:
http://www.bigmax.ch/oc22/index.php?rou ... duct_id=42
Thank you!
Ernie
Re: Problem with Image Manager
Posted: Wed Jun 29, 2016 4:56 am
by straightlight
R_D wrote:straightlight wrote:
It indicates in your last response that you would try it but no results were posted afterwards. Would it be possible to post more details about this?
Well, the 'temporary' fix worked, I forgot to give feedback. But there must be a reason why the base URL isn't in the sitemap without that fix...
Is it a contribution sitemap you're using or the google sitemap from the core?
Re: Problem with Image Manager
Posted: Wed Jun 29, 2016 5:12 am
by R_D
Is it a contribution sitemap you're using or the google sitemap from the core?
It's a contribution sitemap, but the problem also exists in the google sitemap from the core
Re: Problem with Image Manager
Posted: Wed Jun 29, 2016 5:14 am
by straightlight
I would probably have to test this directly since relative path may differ between servers.
Re: Problem with Image Manager
Posted: Thu Jun 30, 2016 10:03 pm
by minu
Hello, can anyone explain me step by step how to solve this issue?I made some changes like here but it didn't work, maybe i forget some steps

Re: Problem with Image Manager
Posted: Thu Jun 30, 2016 10:09 pm
by straightlight
minu wrote:Hello, can anyone explain me step by step how to solve this issue?I made some changes like here but it didn't work, maybe i forget some steps

Can you elaborate that a little?
- Which OC version?
- What is the main issue you are reporting about?
- What were the effect after changes?
Re: Problem with Image Manager
Posted: Thu Jun 30, 2016 10:40 pm
by minu
I have the same problem like in the first post, if i try to upload an image in the description it's just simply open my image in another link.
I try to modify my code like here:
In admin/controller/common/filemanager.php file,
find:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) {
replace with:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name']) && is_uploaded_file($this->request->files['file']['tmp_name'])) {
Then, try the action again. With this replacement, it not only verifies the source file but also valdates if the file has been successfully uploaded to the server.
As for this line:
Code: Select all
$filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'));
There are three files in OC v2.2.0.0 that shows as such and I don't entirely agree with this. That being said, each should be replaced with:
Code: Select all
$filename = html_entity_decode(basename($this->request->files['file']['name']), ENT_QUOTES, 'UTF-8');
And nothing happend.Can you tell me how to solve this problem, step by step?I have OP 2.2.0.
Thanks!
Re: Problem with Image Manager
Posted: Thu Jun 30, 2016 10:52 pm
by straightlight
After the replacement, if there are no difference, it means the file you are trying to upload has never reached the server.
Re: Problem with Image Manager
Posted: Sun Jul 03, 2016 8:59 pm
by R_D
straightlight wrote:I would probably have to test this directly since relative path may differ between servers.
Sorry for answering so late (family business..)
I've done some things myself and for no apparent reason when I altered the catalog/model/tool/image.php file
(I've only copied this line "return $this->config->get('config_url') . 'image/' . $new_image;" and pasted it over the line above changing only config_url into config_ssl ) it worked
I had to remove the steps from the other post in the sitemap controller file because of duplicate base urls in the sitemap, but it then worked... Strange isn't it?
Re: Problem with Image Manager
Posted: Sun Jul 10, 2016 5:32 pm
by esk1mox
Hi, Not I understand your changes in image.php file. Can you please clarify the steps IF this solved the uploading issue?
Many thanks

Re: Problem with Image Manager
Posted: Sun Jul 10, 2016 8:11 pm
by straightlight
R_D wrote:straightlight wrote:I would probably have to test this directly since relative path may differ between servers.
Sorry for answering so late (family business..)
I've done some things myself and for no apparent reason when I altered the catalog/model/tool/image.php file
(I've only copied this line "return $this->config->get('config_url') . 'image/' . $new_image;" and pasted it over the line above changing only config_url into config_ssl ) it worked
I had to remove the steps from the other post in the sitemap controller file because of duplicate base urls in the sitemap, but it then worked... Strange isn't it?
A clue I did discovered from catalog/controller/common/header.php file is:
Code: Select all
if ($this->request->server['HTTPS']) {
which should be changed to:
Code: Select all
if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
This should resolved the problem at least for site redirection issues.
Re: Problem with Image Manager
Posted: Sun Jul 10, 2016 8:35 pm
by straightlight
I also created a tweak for the site redirection library where the link would be originally use:
http://forum.opencart.com/viewtopic.php ... 85#p628049 .
Re: Problem with Image Manager
Posted: Tue Jul 12, 2016 1:11 am
by R_D
Wow, this is great! I've already had some things altered without that but I see I've missed some things. I will work on it tomorrow and will let you know if it works (and if not what exactly doesn't work).

Re: Problem with Image Manager
Posted: Tue Jul 12, 2016 1:16 am
by R_D
esk1mox wrote:Hi, Not I understand your changes in image.php file. Can you please clarify the steps IF this solved the uploading issue?
Many thanks

this is for uploading issues with the Image manager:
straightlight wrote:While one may be able to upload, since each server configurations may differ, screenshots would be inaccurate in this case since there are developed and engineered functions that are able to troubleshoot uploaded files on a web server as the reported issue only requires troubleshooting.
In admin/controller/common/filemanager.php file,
find:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) {
replace with:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name']) && is_uploaded_file($this->request->files['file']['tmp_name'])) {
Then, try the action again. With this replacement, it not only verifies the source file but also valdates if the file has been successfully uploaded to the server.
As for this line:
Code: Select all
$filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'));
There are three files in OC v2.2.0.0 that shows as such and I don't entirely agree with this. That being said, each should be replaced with:
Code: Select all
$filename = html_entity_decode(basename($this->request->files['file']['name']), ENT_QUOTES, 'UTF-8');
Re: Problem with Image Manager
Posted: Tue Jul 12, 2016 1:30 am
by straightlight
R_D wrote:esk1mox wrote:Hi, Not I understand your changes in image.php file. Can you please clarify the steps IF this solved the uploading issue?
Many thanks

this is for uploading issues with the Image manager:
straightlight wrote:While one may be able to upload, since each server configurations may differ, screenshots would be inaccurate in this case since there are developed and engineered functions that are able to troubleshoot uploaded files on a web server as the reported issue only requires troubleshooting.
In admin/controller/common/filemanager.php file,
find:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) {
replace with:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name']) && is_uploaded_file($this->request->files['file']['tmp_name'])) {
Then, try the action again. With this replacement, it not only verifies the source file but also valdates if the file has been successfully uploaded to the server.
As for this line:
Code: Select all
$filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'));
There are three files in OC v2.2.0.0 that shows as such and I don't entirely agree with this. That being said, each should be replaced with:
Code: Select all
$filename = html_entity_decode(basename($this->request->files['file']['name']), ENT_QUOTES, 'UTF-8');
This is an experimental tweak so to avoid using the slashes versus the non-slashed server paths. There are also servers who tends to repeat the referrer URL into the super global objects which will definitely affect site redirections. As for the rest of the posts on that topic, it covers fixing for SSL validations.
Re: Problem with Image Manager
Posted: Tue Jul 26, 2016 2:14 pm
by karlleh
IP_CAM wrote:after replacing this line, in the:
oc22/admin/view/javascript/common.js
Line 152, in my OC v.2.2.0.0:
$('#modal-image a.thumbnail').on('click', function(e) {
with this line:
$('#modal-image').delegate('a.thumbnail', 'click', function(e) {
it works perfect !
Ernie
PS. And this may help, if someone uses 'illegal' white space image File Names:
http://forum.opencart.com/viewtopic.php ... 84#p625218
This actually solves my problem of not able to select and insert an image into the WYSIWYG editor (It opens the image in the current tab instead).
This problem occurs whenever you:
1) Open a subfolder and select an image
2) Go to next page to select another image
Re: Problem with Image Manager
Posted: Sat Jul 30, 2016 6:34 am
by straightlight
An official fix has now been released for the Image Manager:
http://forum.opencart.com/viewtopic.php ... 80#p631280 . Try it to see if that solves the issue.
Re: Problem with Image Manager
Posted: Thu Sep 28, 2017 8:53 am
by chris777
So this still works to make thumbnails show in OC 2.3?
All i see now is the file name.
thanks
chris
straightlight wrote: ↑Wed Jun 29, 2016 1:02 am
Now that we know the above was a bug, I would suggest to apply the same fixes to the following files for OC v2.2.0.0 release:
- admin/controller/catalog/download.php file
- admin/controller/feed/google_base.php file
This should definitely rectify the issue.
As for the rest of the upload files that wasn't covered in the topic, here are the following fixes as well.
In admin/controller/extension/installer.php file,
find:
Code: Select all
if (strrchr($this->request->files['file']['name'], '.') == '.xml') {
replace with:
Code: Select all
if (is_uploaded_file($this->request->files['file']['name']) && strrchr($this->request->files['file']['name'], '.') == '.xml') {
In admin/controller/tool/upload.php file,
find:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) {
replace with:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name']) && is_uploaded_file($this->request->files['file']['tmp_name'])) {
In your catalog/controller/tool/upload.php file,
find:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name'])) {
replace with:
Code: Select all
if (!empty($this->request->files['file']['name']) && is_file($this->request->files['file']['tmp_name']) && is_uploaded_file($this->request->files['file']['tmp_name'])) {
Then, find:
Code: Select all
$filename = basename(html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'));
replace with:
Code: Select all
$filename = html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8');
As for this line, I have no idea why it would be the
only line matching for REGEXP compared to the rest of the other uploads in the platform:
Code: Select all
$filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8')));
replace with:
Code: Select all
$filename = html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8');
If there is really something special about that line and should be the only line to where special chars should be considered throughout the rest of the
same process of Opencart, at least - if there's one thing useful about GitHub would be to document the difference on that upload !
Re: Problem with Image Manager
Posted: Sat Sep 30, 2017 10:38 pm
by chris777
Problem Solved. 
Thumbnails now showing in Image Manager,
Maybe this will help others.
My issue was in my ADMIN CONFIG file;
<?php
// HTTP
define('HTTP_SERVER', '
http://frogsale.com/admin/');
define('HTTP_CATALOG', '
http://frogsale.com/'); <--------this line had '
http://frogsale.com/frogsale.com" which was wrong.....i changed it to what you see now and thumbnails appeared!
Thanks for everybodys suggestions!
chris