Post by fahmiazlan » Wed Aug 21, 2013 11:08 pm

andy-man wrote:--- SOLVED ---
PROBLEM
Got the same problem here.
Image
So let's look in HTML code of file manager iframe. A lot warnings...
Ex.:

Code: Select all

Warning: mysql_connect(): User _user1 already has more than 'max_user_connections' active connections in /home/public_html/d-apple/system/database/mysql.php on line 6
As it says there are a lot of connection to database.
Why does it happen? OpenCart's filemanager makes a LOT of ajax requests while building imgs' previews (jpg 100x100).
Whatever... you want to know how to fix it? There is very easy way to get rid of this issue :)
SOLUTION
All this evil is inside this file:
\admin\view\template\common\filemanager.tpl
Here's my filemanager.tpl (openCart 1.5.5.1) already patched.
filemanager.tpl
ENJOY


Thanks mate!!
i have done already! O0

Newbie

Posts

Joined
Mon Aug 19, 2013 4:20 pm

Post by manoetalk » Wed Sep 11, 2013 7:41 am

Very good!! I
Was going crazy with this login screen.
But now, the banner editing, the file manager does not open enough to see the images.
Show only the folders.
How to solve this?
His solution is 90%

Newbie

Posts

Joined
Thu Aug 01, 2013 3:26 am

Post by ant0nk » Sun Nov 03, 2013 4:58 pm

I have the same issue. Could someone explain please why this queue of ajax queries leads to multiple connections? Shouldn't it use existing one connection? Or there are also involved limit of queries opened per connection?

Newbie

Posts

Joined
Sun Nov 03, 2013 4:51 pm

Post by shepscrook » Wed Jan 01, 2014 3:47 am

I am now having the same issue on one of my sites.

I've rebuilt the site from scratch and am still having this issue. I'm on hostgator with unlimited diskspace and bandwidth.

Newbie

Posts

Joined
Wed Aug 07, 2013 11:38 pm

Post by shepscrook » Fri Jan 24, 2014 1:16 am

And now a second site is having this issue.

Anyone have a full fix or idea what this issue is?

Newbie

Posts

Joined
Wed Aug 07, 2013 11:38 pm

Post by Mistah » Tue Feb 11, 2014 12:02 am

I think this is a serious bug and needs to be fixed in an update! The OpenCart is almost useless with this error! Admins please report this bug!! :o
I'm waiting for a good fix!

Newbie

Posts

Joined
Mon Feb 10, 2014 11:56 pm

Post by Mistah » Tue Feb 11, 2014 4:18 am

Hi there! I think i found the problem for this issue. I has got to do with the max number of database connection per user. At the webhost i'm at now its limited to 3 connections per user and i think when the image manager starts to make or receive thumbnails for the images it uses more connections to the database. So when the limit has reached the image manager shows the login screen error. You can see the fault in firebug. I tested it out on my local server and got the same error results when i set the max connections per user also to 3. (default=0(unlimited?)on my wamp server)
SQL-query:

Code: Select all

SHOW VARIABLES LIKE 'max_user_connections';
When i set this to :

Code: Select all

SET GLOBAL max_user_connections = 0;
then the error was gone.

You can set this in the phpMyAdmin - "Run SQL query/queries on server" if you have enough rights to set this setting. Maby

Code: Select all

SET GLOBAL max_user_connections = 15;
is enough. This setting can not always be done, depends on your webhoster.


So if you can't change the setting, change hosting if the filemanager.tpl isn't fixed in a update.

Newbie

Posts

Joined
Mon Feb 10, 2014 11:56 pm

Post by chunwu » Wed Mar 19, 2014 8:06 am

vicky241 wrote:Hello,

My name is Vicky

I'm having a big problem with the Image manager to upload and add images to my products.

When i click to search for images the image manger pops up,
strangest thing of all is that after 3 secondes the admin login screen appears where the images belongs and the background changes after my buttons.

I attached a printscreen of my image manager as i see it.

Image
I had the exact same problem after I made a few changes on products and uploaded a few images. I got rid of the problem by restarting MySQL database.

Newbie

Posts

Joined
Wed Mar 19, 2014 8:00 am

Post by butte » Wed Mar 19, 2014 7:58 pm

Allowable connections can be approached by changing from mysql to mysqli or even to pdo. Extensions button top right leads to both. With php 5.4 and up expect difficulties, elect 5.3 if possible.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by timparnell » Tue Jun 24, 2014 6:33 am

OK, not the the exact same issue but I just had a similar issue (that's how i found this thread).
I needed customer_group to have an image for a project.

So I take admin/category files (controller, language, model and template) and copy over everything I think is connected.
Now I have image uploader in Customer Group - lovely. Except every time i click browse I get the image uploader with the Login screen - so that is when i searched for thread...

Someone's comment about the session conflicting made me search the category files again.... and i found a line I had missed.
This was in the controller

after the last line with a token set in the breadcrumbs and stuff

Code: Select all

$this->data['cancel'] = $this->url->link('sale/customer_group', 'token=' . $this->session->data['token'] . $url, 'SSL');
between that and the code for the image uploader there was this line

Code: Select all

$this->data['token'] = $this->session->data['token'];


I copied it over and now my image uploader works perfect.
It seems the session token wasn't being passed to the uploader....

Not sure if this is directly relevant - but maybe it helps someone somewhere with image uploader problems.

Tim

tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk


User avatar
New member

Posts

Joined
Wed Feb 01, 2012 11:03 pm
Location - Norwich, Norfolk, UK

Post by Different » Wed Sep 10, 2014 9:44 pm

fahmiazlan wrote:
andy-man wrote:--- SOLVED ---
PROBLEM
Got the same problem here.
Image
So let's look in HTML code of file manager iframe. A lot warnings...
Ex.:

Code: Select all

Warning: mysql_connect(): User _user1 already has more than 'max_user_connections' active connections in /home/public_html/d-apple/system/database/mysql.php on line 6
As it says there are a lot of connection to database.
Why does it happen? OpenCart's filemanager makes a LOT of ajax requests while building imgs' previews (jpg 100x100).
Whatever... you want to know how to fix it? There is very easy way to get rid of this issue :)
SOLUTION
All this evil is inside this file:
\admin\view\template\common\filemanager.tpl
Here's my filemanager.tpl (openCart 1.5.5.1) already patched.
filemanager.tpl
ENJOY
Hey guys the link is broken. Can anybody please re-upload the patched image manager or attach it here?

New member

Posts

Joined
Thu Nov 17, 2011 2:22 am

Post by guilherm » Fri Sep 19, 2014 1:09 am

I am having the same issue with Image Manager as well...

Please someone re-post the solution in the broken link

Thanks.

Newbie

Posts

Joined
Fri Sep 19, 2014 1:05 am

Post by felipeandrada » Wed Oct 01, 2014 11:17 pm

In my case the server don't return the image properly if the last query parameter "&image=" have a dot on the filename "image.jpg" ...

I just reorder the params in the filemanager.tpl and others. Set the &token= to the last parameter.

I did a vqmod for this. Tested on oc 1.5.6.4.

Code: Select all

	<file name="admin/view/template/common/filemanager.tpl">
		<operation>
			<search position="replace"><![CDATA[&token=<?php echo $token; ?>&image=' + encodeURIComponent('data/' + $(element).find('input[name=\'image\']').attr('value'))]]></search>
			<add><![CDATA[&image=' + encodeURIComponent('data/' + $(element).find('input[name=\'image\']').attr('value'))+'&token=<?php echo $token; ?>']]></add>
		</operation>
	</file>

	<file name="admin/view/template/catalog/*">
		<operation>
			<search position="replace"><![CDATA[&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value'))]]></search>
			<add><![CDATA[&image=' + encodeURIComponent($('#' + field).attr('value')) + '&token=<?php echo $token; ?>']]></add>
		</operation>
	</file>

Newbie

Posts

Joined
Wed Oct 01, 2014 11:09 pm

Post by bigbrother72 » Fri Apr 17, 2015 9:04 pm

felipeandrada wrote:In my case the server don't return the image properly if the last query parameter "&image=" have a dot on the filename "image.jpg" ...
Thanks, mate!

Newbie

Posts

Joined
Wed Nov 11, 2009 1:10 am

Post by authentic » Thu Dec 21, 2017 12:24 pm

Hello,
I am having this same problem with the image manager timing out of session. The filemanager.tpl file that was uploaded as a fix is not accessible. The max database sessions allowed # cannot be changed on my host. What can I do to solve this problem? Anyone?
Thank you!

Newbie

Posts

Joined
Mon Dec 18, 2017 2:40 pm
Who is online

Users browsing this forum: No registered users and 9 guests