Crud: elfinder: Unable to open '#' Folder not found.

Created on 25 Jan 2017  路  13Comments  路  Source: Laravel-Backpack/CRUD

When opening the elfinder, i am getting the following error in JS console:
elfinder debug: [error] [elfinder] Unable to open "#".<br>Folder not found.

I am using the following disk:
'uploads' => [ 'driver' => 'local', 'root' => public_path('uploads'), ],

Somehow an empty string is given as folder, therefore the '#.....', any ideas?

question

Most helpful comment

Hi,

I had the same problem and after searching for a while, I've successfully tracked the problem.

On the line 3457 of elfinder.full.js, the is an event bound on the window called _message_ which call an additional request. When calling a new request, it aborts current requests of type open.

Now, the problem was one of my extension installed on Chrome, Grammarly in my case. That extension was triggering message on page load, aborting the initial request of elFinder. When it was doing the .sync, the target param sent in get was empty, causing the error.

From what other users are saying, they might have the same problem. Elfinder works on other browsers since they probably have no extensions.

Now, the fix was easy, disabling the extension solved everything, but it is not practical. In the end, the problem is not with CRUD, nor Laravel-Elfinder, it is in elFinder itself. I'm relatively new to Github, so if someone could reference this issue to elFinder (or even better teach me), it would be nice!

The question to elFinder authors is: Would using a prefix for the event instead of a namespace be possible? It would solve that problem at least.

All 13 comments

Hmm... Have you created the "uploads" folder?

yes I have

It didnt work in Chrome. It did in Safari. I added a setTimeout and it worked again for Chrome. any ideas what the actual cause could be?

`

Tested on 2 different configurations and same behaviour in both. So, don麓t think is a server issue.

1.- XAMPP v3.2.1 on windows.
2.- Ubuntu 16.04.2, PHP 7.1, Nginx in Digital Ocean.

Hi all, I'm seeing the same with same error message. I'm running WAMP 2.5 on Windows 10 with Chrome 58. Firefox (53) is fine as is Edge (38).

Same problem here too (just noticed)
Running on a mac with Valet
Chrome v58 => finder does not 'fully' appear
Chrome Canary v60 => OK
Firefox => OK

show connector.php file then i solve your problem

````

use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;

/**

  • Extended elFinder connector
    *
  • @author Dmitry (dio) Levashov
    **/
    class Connector extends \elFinderConnector {
/** @var Response */
protected $response;

/**
 * @return Response
 */
public function getResponse(){
    return $this->response;
}

/**
 * Output json
 *
 * @param  array  data to output
 * @return void
 * @author Dmitry (dio) Levashov
 **/
protected function output(array $data) {

    $header = isset($data['header']) ? $data['header'] : $this->header;
    unset($data['header']);

    $headers = array();
    if($header){
        foreach((array) $header as $headerString){
            if(strpos($headerString, ':') !== false){
                list($key, $value) = explode(':', $headerString, 2);
                $headers[$key] = $value;
            }
        }
    }

    if (isset($data['pointer'])) {
        $this->response = new StreamedResponse(function () use($data) {
                if (stream_get_meta_data($data['pointer'])['seekable']) {
                    rewind($data['pointer']);
                }
                fpassthru($data['pointer']);
                if (!empty($data['volume'])) {
                    $data['volume']->close($data['pointer'], $data['info']['hash']);
                }
            }, 200, $headers);
    } else {
        if (!empty($data['raw']) && !empty($data['error'])) {
            $this->response = new JsonResponse($data['error'], 500);
        } else {
            $this->response = new JsonResponse($data, 200, $headers);
        }
    }
}

}
``

Hi guys. Since we weren't able to officially replicate it, it's most likely and installation/configuration mishap, so I'll close the issue. Feel free to continue to post here if you stumble upon the issue again, and ask to reopen it if you think I'm wrong.

Cheers!

Hi,

I had the same problem and after searching for a while, I've successfully tracked the problem.

On the line 3457 of elfinder.full.js, the is an event bound on the window called _message_ which call an additional request. When calling a new request, it aborts current requests of type open.

Now, the problem was one of my extension installed on Chrome, Grammarly in my case. That extension was triggering message on page load, aborting the initial request of elFinder. When it was doing the .sync, the target param sent in get was empty, causing the error.

From what other users are saying, they might have the same problem. Elfinder works on other browsers since they probably have no extensions.

Now, the fix was easy, disabling the extension solved everything, but it is not practical. In the end, the problem is not with CRUD, nor Laravel-Elfinder, it is in elFinder itself. I'm relatively new to Github, so if someone could reference this issue to elFinder (or even better teach me), it would be nice!

The question to elFinder authors is: Would using a prefix for the event instead of a namespace be possible? It would solve that problem at least.

@kagagnon thanks a lot for sharing your findings. It makes a lot of sense now - for it to be a Chrome extension :-)

Here's the elFinder repository - https://github.com/Studio-42/elFinder

Cheers!

Was this page helpful?
0 / 5 - 0 ratings