Search code examples
javascriptjqueryhtmlcsselfinder

elFinder issues. Undefined is not a function error when trying to copy file


I'm trying to implement elFinder file manager.

This is what I've done. Included files:

    $arr_css = array(
              "main.css",
              "jquery-ui.css",
              "elfinder.min.css",
               "theme.css"
              );
    $arr_js = array(
               "jquery.js",
               "main.js",
               "jquery-ui.js",
               "elfinder.min.js",
               "elfinder.ru.js"
               );

(main.js and main.css are arrays used to create <link rel='stylesheet'> and <script type='text/javascript'>)

In my main page there is a

<div id='fileStructure'>
    <div id="elfinder"> </div>
</div> 

which I use to initialize elfinder:

$(document).ready(function() {
    var elf = $('#elfinder').elfinder({
        lang: 'ru',             // language (OPTIONAL)
        url : '/radio/elfinder-2.0-rc1/php/connector.php'  // connector URL (REQUIRED)
    }).elfinder('instance');            
});

enter image description here

This is, what I have now. It looks fine, I can create directories, files, can upload them. But when I try to copy it it says:

Uncaught TypeError: undefined is not a functionelfinder.min.js:2841 elFinder.commands.copy.execelfinder.min.js:1746 (anonymous function)elfinder.min.js:1706 (anonymous function)jquery.js:3058 jQuery.event.dispatchjquery.js:2676 jQuery.event.add.elemData.handle.eventHandle

The same mistake is on other actions like, cut remove and others. When I look in script I see that mistake is in string with

return a.each(this.files(b), function (a, b) {
                if (!b.read || !b.phash) return !d.reject(["errCopy", b.name, "errPerm"])
            }), d.isRejected() ? d : d.resolve(c.clipboard(this.hashes(b))

I don't really understand why it is happening because structure isn't clear for me:

d = this
b = a(b)

and a is parameter of main function of elfinder

(function (a) {

Anyone can help me to solve the problem? May be someone met similar issue? UPDATE

Uncaught TypeError: undefined is not a functionelfinder.min.js:2860 elFinder.commands.cut.execelfinder.min.js:1746 (anonymous function)elfinder.min.js:1706 (anonymous function)jquery.js:3058 jQuery.event.dispatchjquery.js:2676 jQuery.event.add.elemData.handle.eventHandle
Uncaught TypeError: undefined is not a functionelfinder.min.js:4249 elFinder.commands.rm.execelfinder.min.js:1746 (anonymous function)elfinder.min.js:1706 (anonymous function)jquery.js:3058 jQuery.event.dispatchjquery.js:2676 jQuery.event.add.elemData.handle.eventHandle

Solution

  • From your URL (/radio/elfinder-2.0-rc1/php/connector.php) it seems that you're using Elfinder 2.0 RC1.

    You should know that Studio 42 (the company who developed elFinder) hasn't updated or developed any code for elFinder since 2012. The user nao-pon has been responsible for the development and bug fixes lately.

    So, you should download a Nightly build to use the latest updated code. That should probably solve your issues.