Page 2 of 3

Re: Troubles with the image manager oc 1.5.5.1

Posted: Sat Jul 06, 2013 2:33 am
by butte
See PM in a couple of minutes . . .
. . . Sent.

Nice, by the way. And in Portuguese.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Sun Jul 07, 2013 9:59 pm
by GugaJedi
butte wrote:See PM in a couple of minutes . . .
. . . Sent.

Nice, by the way. And in Portuguese.
I've needed to remove English because of the products, was very hard to add new products and write everything in two languages...

Re: Troubles with the image manager oc 1.5.5.1

Posted: Sun Jul 07, 2013 10:59 pm
by butte
That is safest for the sake of not upsetting the software, let alone when most of your patronage will be fluent in that in the first place.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Sat Jul 20, 2013 1:08 pm
by romulofelix
GugaJedi wrote:
butte wrote:Look in /admin/view/template/common/ (directory) . . .
for /admin/view/template/common/filemanager.tpl (file) . . .

then either rename or delete the old one, filemanager.tpl (it can be replaces from the OC .zip /upload/ tree),
then put the new one there and rename the new one, filemanager1541.tpl to filemanager.tpl . . .

and try it.

Familiarize yourself with your directory structure and files, you'll need the familiarity for reviewing security on your server from time to time.
Butte, I've done the change, the tpl from the 1.5.4.1 version is there, but now the file manager open ok, but show nothing inside it, no folder list, no images in the default directory.

I was going to deploy my store this month, but with this problem I can't put the images to the products, was hard to input the banner images, imagine with 100 products...

my store just for you guys to check: http://www.geekmarket.com.br
Hey guys! I'd like to stress something... Looking for a solution, I was wondering that it had something to do with quantity and/or number of images inside the ".../image/data" folder. So I divided images into different folders, this way, the file manager previews only the content inside the selected folder. The problem wasn't solved at all, anyway now it happens less frequently.
I've done the procedures Butte has suggested, and I've got the same problem Guga has got, now no files are shown. I feel embarrassed and I don't have any idea of what to do anymore. ' hope we can find the solution soon.
Best regards!

Re: Troubles with the image manager oc 1.5.5.1

Posted: Mon Jul 22, 2013 11:28 pm
by butte
(1) The IM problem's (or problems') frequency fell to Intermittence where romulofelix redistributed images into subdirs, but it remained uninterrupted where GugaJedi had already sorted images into subdirs. Having done that, romulofelix, you may need to reinsert images after OC updates its cache/data to match the data/ originals' distribution.

Uploads themselves go into /image/data including any further subdirs/ manually made there, and from all of that the IM then displays loadable thumbnails in image/cache/data including the same subdirs. You can think of them as sea Captain and seafaring Parrot who at the moment are not getting along very well with Sunday School.

Whenever ftp is utilized, there arise necessities to ensure that binary images are not sent (or received) as ascii gibberishities, and that passive or active mode matches the server's requirements, among several other things that prevent corruptions. Uploading with an actual and robust ftp client, such as FileZilla Client, will put originals where they belong in /image/data/ in order for OC to thumbnail them into /image/cache/data.

(2) Background json and Ajax may be contributing. Meanwhile, IM seems to have been doing at least some of its essential job. It appears that 0-byte failed uploads are, properly, not thumbnailed. It appears that even substantial enlargements into thumbnails are, properly, producing decent images (as in turning a 52,700 image into a 102,871 thumbnail). Such filespec strings as "inifrån" or "döden" raise need to set character encoding properly (browser, ftp, code).

(3) The mix isn't entirely clear, yet, in GugaJedi's instance, but some direct approaches and a workable workaround are being evaluated now.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 3:25 am
by andy-man
--- 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

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 4:22 am
by butte
iframe?

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 4:42 am
by andy-man
butte wrote:iframe?
Yep, filemanager.tpl is loaded to iframe of dialog div

Code: Select all

<iframe src="index.php?route=common/filemanager&token=28bb409c3b62462ef2c4c5d9ac6ca83b&field=image" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe>

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 5:17 am
by butte
In specifically which file is the iframe itself? (In specifically which file does <iframe [...]> appear?)

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 6:01 am
by andy-man
The iframe itself is created dynamically with help of jquery
For.ex. like this:

Code: Select all

$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
You can find it in following files:
admin\view\template\catalog\category_form.tpl(278)
admin\view\template\catalog\manufacturer_form.tpl(79)
admin\view\template\catalog\option_form.tpl(173)
admin\view\template\catalog\product_form.tpl(1210)
admin\view\template\design\banner_form.tpl(117)
admin\view\template\sale\voucher_theme_form.tpl(47)
admin\view\template\setting\setting.tpl(1058)
admin\view\template\setting\store_form.tpl(547)

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 7:04 am
by butte
(A) The reason for the question is that the <IFRAME> is rendered when index.php reiterates, but from .js code summoned when index.php reiterates. It can be passed through any .tpl (or other) files that draw upon the same .js code. (B) Two solutions, (3) and (4), infra, will be tried live in a short while. (C) After taking the cue given by the snippet /public_html/d-apple/ to look at d-apple.com graphics designers, and at d-apple.net Diamond Apple apple juices, neither presenting OC, I am left to assume that the /d-apple/ was coined for another reason.

(1) Virgin OC files do not have <IFRAME> in .tpl, nor in .php control or model files, nor in index.php files. The filemanager.tpl does not even have the substring "iframe" buried in code, nor "id" or "name" relative to any "iframe" substring. The filemanager.tpl calls Ajax 21 times in virgin 1.5.5.1, 23 times in the proposed repair file (linked a couple of posts above), 23 times in virgin 1.5.4.3; each calls to src= in <HEAD> to two .js files. There is in called jquery/ui/jquery.bgiframe-2.1.2.js a function for $.fn.bgiframe at line 9, with no reference to id or name for iframe. There is in called jquery/ajaxupload.js an initial _createIframe: function(){ at line 487, with var id = getUID(); at line 490, name="' + id + '" at line 498, iframe.setAttribute('id', id); at line 503, window.frames[iframe.id].document; at line 571, and no approximation otherwise to a strict anchor "name" reference to the iframe with its id. (Typically an onClick aiming at parent.[targetname].location requires that anchorname, and in the present problem evidently the .js is throwing it together on the fly with adequate opportunity to unanchor in a goof.) Both of those iframe swaths in .js ramble on for a little while.

(2) That raises a possibility of mistaken "target" somewhere in overall execution, preventing filemanager from following through when returning anything to where it belongs (parent or otherwise). It could be as simple as omission of customery target name. However, tracking that down, one way or t'other, doesn't seem to promise glee.

(3) The filemanager.tpl versions noted here raise a further possible problem in their alert(thrownError iterations of "\r\n" a few dozen times. See Daniel's comment, http://forum.opencart.com/viewtopic.php ... 13#p387863 -- change "\r\n" to "\n" (it has to do with machine-think and is not limited to mail). A quick find-and-replace edit arms that alternative for testing. (Also a good time to kill the trailing 16 tabs on lines 406 and 481, etc..)

[EDIT:] SOLUTION (3) WORKS. Changing the 18 [in some file versions, 20] instances of "\r\n" to "\n" in the 1.5.5.1 filemanager.tpl arms its capacity to navigate among directories and images. That can be done in a single pass with find/replace in a text editor. Doing so amends line terminating syntax but does not affect core code otherwise. For varied reasons solution (3), instant, was elected and kept as preferred in the production box.]

(4) The proposed replacement code primarily replaces original line 244, after this line -- for (i = 0; i < json.length; i++) -- which remains. The change is relatively subtle, but is worth testing.

[EDIT:] SOLUTION (4) WORKS. Changing the code as proposed in (and linked to)filemanager.tpl arms its capacity to navigate among directories and images. Doing so amends core code. For varied reasons solution (3), supra, was instead elected and kept as preferred in the production box.]

(5) If by chance both of those work, then they can be combined.

[EDIT:] SOLUTION (5) WORKS. Combining the two solutions in (3) and (4) also works. Doing so amends core code. For varied reasons solution (3), supra, was instead elected and kept as preferred in the production box.]

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 8:41 am
by andy-man
Just few comments:

(A) Forget about d-apple. I just edited line with error a little bit, to hide real host and database names (for security reason).
(1) "Virgin OC files do not have <IFRAME>" Are you sure? But what is on line 1210 of admin\view\template\catalog\product_form.tpl(1210)

Code: Select all

$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
Call me completely blind, but it do have "iframe" string. (product_form.tpl of VIRGIN oc 1.5.5.1)
(3) I don't care about that, as long as it don't bother me :) But you can make you own version with those editings.

I've updated a little bit my filemanager.tpl
Now when you hold CTRL and click on image icon - OC updates/creates it's preview
Here is my Filemanager.tpl
For those who has weak hosting or anybody, who've got that issue with Image manager and logout problem (mysql exceeds max connections limit)
Link is the same {Filemanager.tpl}

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 23, 2013 12:45 pm
by butte
Of the three aforesaid tests, all three worked (amend line-termination code only, amend querying, amend both). The simplicity of the first approach, of changing only the 18 [in some file versions, 20] instances of "\r\n" to "\n" in the 1.5.5.1 filemanager.tpl, was elected as preferred in the production box.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Fri Jul 26, 2013 5:48 am
by bLIGU
AnyOne has solved this issue? How?

Re: Troubles with the image manager oc 1.5.5.1

Posted: Fri Jul 26, 2013 12:10 pm
by butte
The simplicity of changing only the 18 [in some file versions, 20] instances of "\r\n" to "\n" in the 1.5.5.1 filemanager.tpl suffices.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 30, 2013 12:26 pm
by rodrigoer
Works for me
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

For me, now it doesn't crush.
BUT... i can't see the images.
check this.
Image

What can i do?

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 30, 2013 10:27 pm
by butte
"What can i do?" Try the other one, http://forum.opencart.com/viewtopic.php ... 20#p423617 above -- relating just to line feeds and carriage returns, rather than to database.

Re: Troubles with the image manager oc 1.5.5.1

Posted: Tue Jul 30, 2013 11:17 pm
by rodrigoer
butte wrote:"What can i do?" Try the other one, http://forum.opencart.com/viewtopic.php ... 20#p423617 above -- relating just to line feeds and carriage returns, rather than to database.
I tried. But system crush...
:/

Re: Troubles with the image manager oc 1.5.5.1

Posted: Wed Jul 31, 2013 4:58 am
by butte
Try fetching the brand-newest standard or full package from ckeditor.com/download/ and put that into admin/view/javascript/cdkeditor/ (you can rename the existing ckeditor/ directory so that it will remain as its own backup, then add a new ckeditor/ directory for the replacement). That cures several subtle problems in 1.5.5.1 and evidently does not cause any new ones. (Then the linefeed edit should work -- ckeditor was replaced before the edit, in the situation tested.)

Re: Troubles with the image manager oc 1.5.5.1

Posted: Wed Jul 31, 2013 6:27 am
by dmsims
I have given up with Image mangler

It's a POS and you cannot give it to a customer to use

Life is too short and I bought an extension to replace it - problem solved