Crud: [Bug] tinymce elfinder link not working

Created on 18 Aug 2017  路  13Comments  路  Source: Laravel-Backpack/CRUD

Right now if I choose to add a link to the text I have the option to link it to a file. So when I do so I can see all my files fine, upload fine, but when I add the link its a jibersh path. The files are all stored using local storage:

'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

But the link I get is:
elfinder/connector?_token=cf15xM4AWQUbROs0nVFpHLrluQtYdn4A9pYQYGOJ&cmd=file&target=fls2_dXBsb2Fkcy9QREZzL0Jhbmstb2YtQW1lcmljYS1FRlQtQXBwbGljYXRpb24ucGRm

I can find the actual file here:
uploads/PDFs/Application.pdf

Everything else works fine with my uploads and file systems, its just that odd link value.

Bug MUST

Most helpful comment

Hello everyone who pitched in here.

Thank you very much for your help on debugging this. I'v just submitted PR #3281 that will solve this problem.

I am going to close this, anything else should be addressed in the PR thread. 馃憤

Wish you guys the best,
Pedro

All 13 comments

At the moment I think this is a question, but it might be a bug - when you say you can find the file, assuming that your APP_URL is (say) /myapp/ you can find that file physically at /myapp/public/uploads/PDFs/Application.pdf?

@lloy0076 I can find the file physically there but the link it gives me is that efinder/connector link. It should just be /uploads/PDFs/Application.pdf . If I go to that link I can find the file so I assume the link should be based upon the driver configuration.

my elfinder.php config:


/*
    |--------------------------------------------------------------------------
    | Upload dir
    |--------------------------------------------------------------------------
    |
    | The dir where to store the images (relative from public)
    |
    */
    'dir' => ['uploads'],

    /*
    |--------------------------------------------------------------------------
    | Filesystem disks (Flysytem)
    |--------------------------------------------------------------------------
    |
    | Define an array of Filesystem disks, which use Flysystem.
    | You can set extra options, example:
    |
    */
    'disks' => [
        'public',
    ],

Anyone else had this? Having to put in my own link to is getting hectic.

I just changed my input type to wysisyg and it works now. Still not working with tinymce

So I just checked and the link works (displays the image on my website) but only if I am logged in. I think the link should return the absolute path and not:

elfinder/connector?_token=cf15xM4AWQUbROs0nVFpHLrluQtYdn4A9pYQYGOJ&cmd=file&target=fls2_dXBsb2Fkcy9QREZzL0Jhbmstb2YtQW1lcmljYS1FRlQtQXBwbGljYXRpb24ucGRm

I can post a video of whats going on if that helps.

I don't believe this is a bug.

Checked, I'm able to replicate the issue. The stored URL includes the connector file, which is behind the admin middleware. Bad elfinder. Bad!

So it would seem it's a bug and not a question, right? 馃槃

Did anyone come with a solution? Having the same problem here.

Any news here?

@tabacitu i tried this out. The links are setup just fine.

Is there an edge case this would fail ?

This still failing.

I am having the same issue - these links only work when logged in, meaning all the public content I have set up has broken images. Investigating alternatives now but not sure what to do yet. I am not able to find where the connector URL is established and the admin middleware is applied to see if that's something I can remove.

edit: My fix was to add this to my web.php routing file:

Route::get('/admin/elfinder/connector', ['as' => 'elfinder.connector', 'uses' => '\Barryvdh\Elfinder\ElfinderController@showConnector'])->middleware('web');

I believe forcing the "web" middleware on the route fixed the issue and I can now see images when not logged in.

Hello everyone who pitched in here.

Thank you very much for your help on debugging this. I'v just submitted PR #3281 that will solve this problem.

I am going to close this, anything else should be addressed in the PR thread. 馃憤

Wish you guys the best,
Pedro

Was this page helpful?
0 / 5 - 0 ratings