Thanks for this module.

If I go to http://www.example.com/user/1/imce , imce file browser works fine,

But if I go to http://www.example.com/imce it looks like css or javascript are not loaded and file browser is unusable. "upload" and "remove" buttons disappear.

See atachments:
right
wrong

I've tested this with three different browsers and with cache disabled.

This makes image uploading impossible when clicking file browser button.

Any advice will be appreciated. Thanks.

Federico

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lquessenberry’s picture

I am having the exact issue. I was right in the middle of editing a few nodes with FCKeditor when all of a sudden out of nowhere IMCE just started doing this. It is very annoying.

ufku’s picture

Category: bug » support

First you have to identify if it is js or css issue.
Does directory navigation work? Is there any js errors thrown?

If you think it has something to do with your theme, and as it seems only the tabs disappear try some css workarounds. add this to your theme's css for instance
#ops-wrapper, ul#ops-list {clear: both;}

Daga’s picture

I'm seeing something similar, but I think it is caused by the mod_security configuration. The page itself still loads but any pages that use it as a referrer seem to fail. This seems to only be an issue when I try to access IMCE from BUEditor, which adds "onload" to the URL.

Unfortunately I don't manage the server so I can't turn mod_security off... or write an ignore rule.

Daga’s picture

OK, here's the work-around that got it working for me. It will probably only work if your screen looked like my last screenshot.

* Open BUEditor's library/default_buttons_functions.js and change "onload" to "ol"

* Open IMCE's js/imce_set_app.js and change every reference to "appFields['onload']" to "appFields['ol']"

Save both.

mohammed76’s picture

exact same issue here. only difference is that I have root access to the server,and upon examining mod_security, I found it not installed at all. so it could be something else. however, on my local wamp everything works as expected. makes me doubt it's some server configuration, but what exactly... any hints anybody?

mohammed76’s picture

hi. something to add. I just installed imce on another account on that same server and it worked nicely. means it's specific to that user's installation of drupal. I am trying to debug it and uninstall modules just to see if any of them is causing conflicts. will update this issue if I find out something worthy of notice.

mohammed76’s picture

hi. I have the following in my logs:
Type locale
Date Sunday, May 10, 2009 - 09:12
User admin
Location http://www.nattiq.com/imce?app=nomatter|onload@imceInlineImceLoad
Referrer
Message Parsed JavaScript file sites/all/modules/imce/js/imce_set_app.js.
Severity notice
Hostname 86.108.59.6
Operations

does this help at all?

Daga’s picture

Not necessarily. All that it tells me is that the page was requested. If you have Firefox installed, try installing the "Firebug" extension on it.

I used that to examine the source. When I clicked on the link tags (that include the .css files), it wasn't loading CSS code. That is how I ended up finding my problem.

mohammed76’s picture

hello.

I am happy to report that the issue is solved for me. actually there were a number of meaningless .htaccess files that may have caused the issue. I just deleted all drupal files except for my files directory and then reuploaded it. that solved it for me.

thanks

luco’s picture

um. I got the same problem here.

which .htaccess are you talking about?

gotta be careful with .htaccess files, they're hardly ever "meaningless".

pal_ur’s picture

Hi,

Drupal 6.12, IMCE 6.x-1.2, IMCE Wysiwyg API bridge 6.x-1.0, neither on http://www.example.com/imce/, neither on http://www.example.com/node/add/ -> TinyMCE -> IMCE, nor on http://www.example.com/user/1/imce/ I'm not able to use 'Upload' and directory listing.

On all pages the same problems:

  • 'Upload' string isn't translated, all other strings are
  • clicking on a directory in the directory list panel at the left side happens nothing
  • clicking on 'Upload' text happens nothing, but clicking on other menuitems on the top all othes works fine
  • in TinyMCE -> IMCE the 'Send to TinymCE' string isn't translated, too

In Firefox there is only one error message if I try to user TinyMCE -> IMCE: "this.editor is null".

Can anybody help?

Thanks a lot.

mohammed76’s picture

Hi Luco,

yes, you're right about the .htaccess files. I am sorry about the generalization that I made. well, I am not even sure that it was an issue with one or more .htaccess files but what I did to resolve it shows it was a problem with the file system. I simply deleted all drupal files and directories except for the files directory, and then reuploaded those. this solved my problem. can you try to do this? of course, you need to be careful with your settings.php file during the process.

nicksanta’s picture

Hi, I'm having the same issues. I'm able to click on the folders, and 'browse' through the directories (Although, it is refreshing the page on each click), but i cant select the actual files. Also, the 'upload' and 'send to IMCE' buttons are missing.

It does seem as though some jscript isn't working, i've disabled 'aggregate javascript' in settings > performance. The imce javascript files are getting included, but they aren't affecting the page (Unfortunately i know no-where near enough js to debug this).

This is my setup.
Drupal v6.11
IMCE v1.2
Wysiwg API v2.x-dev (20 May)
IMCE Wysiwyg Bridge v1.0

captcha’s picture

Category: support » bug
FileSize
18.2 KB
18.84 KB

I'm having a similar problem with the Drupal 6.11.
The imce* exception has been added to google analytics.

Interestingly enough, IMCE is working fine with my theme on Drupal 6.10.
Google analytics not installed.

The problem is that, the file browser popup is inactive, and we cannot do anything with the images.
The url for the popup appears to be /imce?app=nomatter|onload@imceInlineImceLoad.

Attached screenshots, okay and notokay.

nicksanta’s picture

AARGH!!

I cam in this morning and THE DAMN THING IS FIXED!

Normally i would be happy, but there are still so many people with this problem, and i dont know why it has suddenly started working again!

The only thing i can say that i actually did on the site between it not working and working is restart php.

Good luck everyone! i really hope you find the solution for it!

luco’s picture

mohammed76, I understand now. sorry, I didn't mean to imply you were not cautious. I'll definitely give this idea a shot. thanks.

luco’s picture

nickurbits, I'm happy for you... in a way :)

but what do you mean, "restart PHP"?

you mean I have to boot my webhost's server? (really, I don't know)

nicksanta’s picture

I meant restart the php service - not sure if that would even do anything, but its the only thing that i can think of that changed. normally on a lamp (linux setup with apache) stack you would do a command like this (as root, or a sudo user)

sudo /etc/init.d/php5 restart
pal_ur’s picture

Tried out, problem is not solved. Seems a bit mystic, that such problem should be solved by a server-side interpreter's restart, but nothing is impossible...

nicksanta’s picture

I can basically guarantee that wouldnt fix the problem. I was just making a point as to how mystical the whole problem is, because there was no intentional changes to the code or database to get it working again.

winarcht’s picture

I also experienced this problem.
But I found out that one of my javascript files caused it.

If you experience this problem, try to comment out the "external javascripts" you use.
What I mean with the "external javascripts" are: the javascript files that are not generated by Drupal (by default).
They could interfere the JQuery that is needed by the IMCE.

Hope it helps.

mcrittenden’s picture

Priority: Normal » Critical

Anybody else made any headway with this?

easp’s picture

I started experiencing the same thing. The filebrowser opened but the upload, send to fckeditor, etc. button row did not appear.

I recently installed the simplemenu module. When I disabled the simplemenu module the filebrowser appeared correctly again.

I am not sure if it is a css or javascript problem. I will report back what I find.

weseze’s picture

I have isolated the problem. At least I think I have. I started experiencing the same problem after writing a small custom module.
+ The links Upload, Thumbnails, Remove, Resize, ... dissapeared
+ the list of files was not clickable anymore
+ the logs disappeared
+ ...
Basically, IMCE was processed correctly by the server and send to the browser, but then the Javascripts that are supposed to make it all work didn't do anything anymore...

Now, the thing that caused this was a little javascript I included in my custom module with drupal_add_js(). It had 1 function and then a very simple jQuery command:

function my_function()
{
    alert('boo');
}

$(document).ready(function() {
    my_function();
});

I commented out the document ready function and IMCE was doing it's job again!

So, I went searching for document ready functions in IMCE and found two!
modules/imce/js/imce.js (line 670)
$(document).ready(imce.initiate).ajaxError(imce.ajaxError);
modules/imce/js/imce.js (line 57)
$(document).ready(imceInline.initiate);

I have not fixed the problem yet. Need to do some searching and learning in the IMCE code for that. When and if I find a fix I will post it here.

weseze’s picture

after some more searching I discoverd the problem isn't with IMCE but with my custom module.

The code above will not produce the problem, this code will:

function my_function()
{
    $('#nonExistingElement').hide();
}

$(document).ready(function() {
    my_function();
});

If the function called produces some sort of error then the IMCE initiate function isn't called anymore.

@easp: I'm guessing that the simplemenu module produces a Javascript error somewhere.

phani’s picture

in my case, disabling the text size module solved the problem (http://drupal.org/project/textsize). apparently one has to be careful mixing modules that use jquery.

(didn't attempt to debug where text size throws an error since i can live comfortably without it.)

phani.

ezra-g’s picture

For those missing the "send to [x]" links and using securepages.module, make sure you have imce* specified as an ignored path.

varr’s picture

Another resolution:

Turn off the IMCE Crop module, which, in it's 6.x-1.x-dev version, is producing a Javascript error:

imce.ops.crop is undefined
imce.ops['crop'].func = imce.cropSettle;\n

---------------
After perusing through numerous issue pages like this and not finding a solution, I was able to stumble upon my solution when I looked at the Firebug errors.

The original problem I had was missing links in the actual IMCE browser:

- Upload [visible]
- Manage Directory [missing]
- Send to tinymce [missing]

It turns out that there was a Javascript error in the IMCE Crop module that was preventing the other menu items from displaying correctly.

jimyhuang’s picture

I have same error too. After hours of survey, just find out because I have javascript errors when visit /imce, but no javascript error when visit user/x/imce.

It's because I enable jquery_update, then use some jquery function only exists jquery 1.3. But /imce only include old version of jquery.
Wrong jquery path:

Correct jquery path with jquery update:

Just see if this can solve the problem.

nicksanta’s picture

I think a solution i had was to remove *all* javascript includes except the IMCE ones when viewing imce/browse. I did that in template.php

mikepetersonwi’s picture

For what it's worth. I've been experiencing a similar issue with the exception that it was working for some files but not others.

I took a .jpg that was not being shown after uploading (the filename was the only thing in the preview panel), opened it in an editor, then saved it as a new name in the same directory. Then I went back to upload it and it previewed just fine. So I wonder if this has something to do with the file being uploaded?

taskswap’s picture

I had the same problem when I enabled jquery.ui to install the jquery accordion module. It seems any Javascript that causes an error during the onload phase causes trouble. I'm not sure why IMCE needs to load the theme, though. It seems like it would make more sense for it to use the admin theme, which would eliminate the problem (for most users).

I solved the problem by copying imce-page.tpl.php into my theme's directory, then replacing the

print drupal_get_js('header');

line with the following:

// We need to remove our theme's JS file
$lines = explode("\n", drupal_get_js('header'));
$newlines = array();
foreach ($lines as $line) {
    if (!stristr($line, "jquery.ui.js")) continue;
    if (!stristr($line, "jquery.ui.accordion.js")) continue;
    if (!stristr($line, "mytheme.js")) $newlines[] = continue;
    $newlines[] = $line;
}
print implode("\n", $newlines);

There are faster PHP mechanisms to do this sort of thing, but this works fine, makes it easy to cut/paste lines to add new filters, and this is an infrequently-accessed component so speed isn't crucial.

It seems like the real solution, though, would be to have IMCE use the admin theme, not the site theme. Most sites load very little custom Javascript in their admin themes. Alternatively, make sure the setup events fire even if other modules cause Javascript errors?

jrosen’s picture

Hi, so I am having a similar issue but I think the cause may be different... I don't have any JavaScript errors coming up in Firebug, but the pane in the File Browser that is supposed to show the file info (name, size, date, etc) is blank and does not even show the headers.

So I think the issue might be that there is some JQuery conflict on multiple JavaScript hooks overriding some event handler. If I switch from my custom theme to Garland all works fine, but I don't have any custom JavaScript in my theme. I have been taking a look at the JQuery code in IMCE, but I am having difficulty in finding out what conflict exists.

Here is a snippet of all the SCRIPT tags in the HTML loaded by FireFox for the IMCE File Browser:

  <script type="text/javascript" src="/misc/jquery.js?j"></script>

<script type="text/javascript" src="/misc/drupal.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/tabs/ui.tabs.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/tabs/tabs.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/extlink/extlink.js?j"></script>
<script type="text/javascript" src="/misc/jquery.form.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/modules/imce/js/imce.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/saveguard/saveguard.js?j"></script>
<script type="text/javascript" src="/sites/all/modules/modules/imce/js/imce_extras.js?j"></script>

<script type="text/javascript" src="/sites/all/modules/modules/imce/js/imce_set_app.js?j"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "lightbox2": { "rtl": 0, "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": 10, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": 0.8, "overlay_color": "000", "disable_close_click": 1, "resize_sequence": 0, "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": 1, "disable_resize": 0, "disable_zoom": 0, "force_show_nav": 0, "loop_items": 0, "node_link_text": "View Image Details", "node_link_target": 0, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "download_link_text": "Download Original", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "", "image_node_sizes": "()", "trigger_lightbox_classes": "", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": 0, "custom_trigger_classes": "", "disable_for_gallery_lists": true, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_start": true, "slideshow_automatic_exit": true, "show_play_pause": true, "pause_on_next_click": false, "pause_on_previous_click": true, "loop_slides": false, "iframe_width": 600, "iframe_height": 300, "iframe_border": 1, "enable_video": 0 }, "tabs": { "slide": false, "fade": false, "speed": "slow", "auto_height": false, "next_text": "Next", "previous_text": "Previous" }, "extlink": { "extTarget": "_blank", "extClass": "ext", "extSubdomains": 1, "extExclude": "", "extInclude": "", "extAlert": "_blank", "extAlertText": "This link will take you to an external web site. We are not responsible for their content.", "mailtoClass": 0 }, "saveguard": { "msg": null }, "imce": { "extensions": "*", "dimensions": "1200x1200", "filenum": 0, "url": "/imce", "clean": true, "prvt": false, "furl": "/sites/default/files", "direct": true, "dir": "images", "perm": { "subnav": 1, "browse": 1, "upload": 1, "thumb": 1, "delete": 1, "resize": 1 }, "dirsize": 35553, "error": false } });
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--

  imce.hooks.load.push(imce.initiateShortcuts);//shortcuts for directories and files
  imce.hooks.load.push(imce.initiateSorting);//file sorting
  imce.hooks.load.push(imce.initiateResizeBars);//area resizing bars
  imce.hooks.list.push(imce.thumbRow); $.extend(imce.vars, {tMaxW: 120, tMaxH: 120, prvW: 40, prvH: 40});//inline thumbs

//--><!]]>
</script>

Does anyone else have any insight or is there any other info I a can offer that might help figure this out?

Thanks in advance.

jrosen’s picture

OK, just found my issue:

It turns out it was a CSS issue in my custom Theme.

I had the following:

DIV
{
	vertical-align: top;
	width: 100%;
}

and changed it to:

DIV
{
	vertical-align: top;
	width: auto;
}

It turns out the original DIV width somehow hid or moved the File Browser content panel so it was not visible anymore.

Hope this info helps someone else out.

ufku’s picture

Category: bug » support
Priority: Critical » Normal

please identify the bug before marking the issue as bug report.

lcampanis’s picture

Title: File browser not showing correctly » File browser not showing correctly [A SOLUTION]
Version: 6.x-1.2 » 6.x-1.4
Component: Code » User interface

Alright guys this shouldn't be a bug related to iMCE necessarily. As it stands in my installation there is a conflict between the theme and iMCE.

I use the Clean theme, which should by far be more stable than most of the themes out there.
I use Rootcandy for the admin theme.

However the theme loaded/processed with iMCE was Clean. No custom js files were loaded, so there wasn't any errors whatsoever.

I happen to be using ThemeKey to assign a theme to particular paths. I added my domain.com/imce in there to use the Rootcandy theme, and everything was back.

If you use Themkey to solve your issue, use this:

drupal:path = imce

I suggest to the developers to try and invistigate why iMCE doesn't work with Clean. I have also filed this under Clean's issues.

redndahead’s picture

FileSize
301 bytes

Although 1.4 isn't recommended anymore here is a patch that fixes this issue for me. Hopefully this will help other people.

mjharmon’s picture

In my case, there was a bug in the script.js file of the theme. The script.js file (via a Drupal.behaviors call) was attempting to set the background of a region that didn't (understandably) exist in the file browser window that IMCE pops up. Once I checked to make sure that the region did exist (and didn't try to set anything on it in the case when it didn't) the file browser behaved correctly.

The moral of this story is, make sure that your javascript is bug free. A failure in one script will often shut down the client side interpreter for all scripts. I would also look pretty hard at any additional js in use in a theme (or module) for any other sorts of bugs.

The overall point is that I'm not 100% convinced that behavior like this on the part of IMCE is a bug within IMCE. I vote that this issue remain around in a knowledge database (or support forum or readme.txt, especially the reminder that a failure in one js file can affect all js files) but that it no longer be active.

matthew_charron’s picture

Version: 6.x-1.4 » 6.x-2.0-rc2
FileSize
152.32 KB

I am having the same issue with the IMCE file browser.
I am using:
Drupal 6
cck 6.x-2.8
IMCE Wysiwyg Api Bridge 6.x-1.1
IMCE 6.x-2.0-rc2
I have gone through all of the install and setup many times with no luck. When the file browser window opens Firebug shows an error that looks like it is Javascript.
I am a Drupal Newbie, and getting in to the code starts to get pretty confusing for me. I am not sure where to go from here.

the error Firebug shows is: Drupal.settings.op_workflow_bonus is null
I attached a screenshot of file browser w/ Firebug error.

i will also mention in case it could be related - the buttons for Font and Text buttons do not show in my CCK editor even though the radio buttons are on in my WYSIWYG setup.

Any help would be greatly appreciated.

ufku’s picture

Status: Active » Closed (fixed)