ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Issue with Rich Text Editor's img File Manager on EE2

January 09, 2013 12:33am

Subscribe [2]
  • #1 / Jan 09, 2013 12:33am

    jafar

    3 posts

    Hi guys
    Ran into this weird with our EE2.

    How to reproduce:
    1. Make sure there are more than 1 upload destination under File Manager.
    2. Edit / create a new page.
    3. Click on the img icon to bring up the upload image file manager.
    4. On the Upload Directory drop-down box, click to switch to another upload destination.

    Result:
    The file list that shows the content of the folder does not change. It is still showing the list from the previous folder.

    Expected Result:
    The file list changes to reflect the content of the new destination folder.

    We are running EE2 2.5.3, with MSM.
    This happens on all the sites under that install.

    I am not sure where to begin to troubleshoot this, so a pointer would be appreciated.

  • #2 / Jan 09, 2013 11:38am

    Kevin Cupp

    791 posts

    Hard to say, jafar, I’m unable to reproduce on my local install. Can you tell if you’re getting any Javascript errors in the console? If you can inspect the actual request your browser is making for the files and see what it’s returning, that would help also. I normally use Firebug in Firefox or Safari’s developer tools for that.

  • #3 / Jan 09, 2013 5:53pm

    jafar

    3 posts

    Hi Kevin
    Thanks for the reply.
    It seems that through Firebug, I can see that nothing is being triggered when I click on the drop-down menu.

    When I load up the edit / create page and click on the img link, I can see index.php?action=directory_content being ran.

    Clicking on the drop-down doesn’t trigger anything.

    The element on the drop-down box as inspected by Firebug:

    <span class="dir_choice_container">
    <label for="dir_choice">Upload Directory:</label>
    <select id="dir_choice" name="dir_choice">
    </span>

    Can’t seem to find reference to that on the script tab on FF (dir_choice_form was there though).

  • #4 / Jan 09, 2013 11:13pm

    jafar

    3 posts

    OK, I compared the response header of the site that works with the site that doesn’t.
    On the site that doesn’t work, it returns:

    TypeError: $(...).dataTable is not a function

    on the Design page, and:

    <h4>A PHP Error was encountered</h4>
    
    <p>Severity: Notice<br />
    Message:  Undefined offset:  0<br />
    Filename: libraries/Filemanager.php<br />
    Line Number: 871

    when clicking on the img link and trying to switch folder.
    Line 871 on libraries/Filemanager.php is of course:

    foreach($dirs as $dir_id => $info)

    so it looks like somehow the dir_id variable didn’t get properly set.

  • #5 / Jan 10, 2013 10:29am

    Kevin Cupp

    791 posts

    I see line 871 in Filemanager.php in 2.5.3 as

    $dir = $dirs[$params['dir_id']];

    Which means $params[‘dir_id’] is 0, and there is no index of 0 in $dirs. So in the datatables() function right above that, it means dir_choice isn’t being grabbed out of the post/get data properly or it’s set to 0. dir_choice is the name of the dropdown form element.

    It’s difficult to say what exactly is causing this. 99% of the time, strange JS issues are resolved by re-uploading the themes folder to make sure you have the correct JS, and then clear your browser cache. If that doesn’t work and you have a support plan, one of our support folks can poke around your install and figure out what the issue is. Or if you figure out how to reproduce on a clean install, it could be a bug. Or, try upgrading to 2.5.5.

  • #6 / Jan 10, 2013 5:17pm

    jafar

    3 posts

    Kevin
    Thanks. That did the trick.
    I copied the themes directory from the working site to the non-working site, and voila it worked!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases