Post by R_D » Wed Jun 29, 2016 4:17 am

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...

R_D
Active Member

Posts

Joined
Sun Jan 09, 2011 3:13 am

Post by IP_CAM » Wed Jun 29, 2016 4:28 am

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
Last edited by IP_CAM on Wed Jun 29, 2016 7:01 am, edited 12 times in total.

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'750 FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Wed Jun 29, 2016 4:56 am

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?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by R_D » Wed Jun 29, 2016 5:12 am

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

R_D
Active Member

Posts

Joined
Sun Jan 09, 2011 3:13 am

Post by straightlight » Wed Jun 29, 2016 5:14 am

I would probably have to test this directly since relative path may differ between servers.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by minu » Thu Jun 30, 2016 10:03 pm

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 :(

New member

Posts

Joined
Mon Jun 13, 2016 2:57 am

Post by straightlight » Thu Jun 30, 2016 10:09 pm

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?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by minu » Thu Jun 30, 2016 10:40 pm

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!
Last edited by straightlight on Sat Jul 23, 2016 7:22 pm, edited 2 times in total.
Reason: Added code tags.

New member

Posts

Joined
Mon Jun 13, 2016 2:57 am

Post by straightlight » Thu Jun 30, 2016 10:52 pm

After the replacement, if there are no difference, it means the file you are trying to upload has never reached the server.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by R_D » Sun Jul 03, 2016 8:59 pm

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?

R_D
Active Member

Posts

Joined
Sun Jan 09, 2011 3:13 am

Post by esk1mox » Sun Jul 10, 2016 5:32 pm

Hi, Not I understand your changes in image.php file. Can you please clarify the steps IF this solved the uploading issue?

Many thanks :)

Newbie

Posts

Joined
Fri Jan 10, 2014 4:39 am

Post by straightlight » Sun Jul 10, 2016 8:11 pm

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.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sun Jul 10, 2016 8:35 pm

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 .

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by R_D » Tue Jul 12, 2016 1:11 am

straightlight wrote: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 .
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). :ok:

R_D
Active Member

Posts

Joined
Sun Jan 09, 2011 3:13 am

Post by R_D » Tue Jul 12, 2016 1:16 am

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');

R_D
Active Member

Posts

Joined
Sun Jan 09, 2011 3:13 am

Post by straightlight » Tue Jul 12, 2016 1:30 am

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.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by karlleh » Tue Jul 26, 2016 2:14 pm

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

Newbie

Posts

Joined
Tue Jul 26, 2016 1:59 pm

Post by straightlight » Sat Jul 30, 2016 6:34 am

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.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by chris777 » Thu Sep 28, 2017 8:53 am

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 !

New member

Posts

Joined
Tue Aug 08, 2017 8:46 pm

Post by chris777 » Sat Sep 30, 2017 10:38 pm

Problem Solved. :banana: 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

New member

Posts

Joined
Tue Aug 08, 2017 8:46 pm
Who is online

Users browsing this forum: No registered users and 30 guests