Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elfinder route issue #233

Closed
AurelDragut opened this issue Nov 14, 2016 · 10 comments
Closed

Elfinder route issue #233

AurelDragut opened this issue Nov 14, 2016 · 10 comments

Comments

@AurelDragut
Copy link

I just made a fresh install to test some ideas and i discovered that there is a problem with elfinder routes: they all miss the "/admin" prefix. Did you change that? Or it needs a fix?

@unbolt
Copy link

unbolt commented Nov 16, 2016

Having the same issue, there appears to be a config file generated for elfinder, and in it this:

'route' => [ 'prefix' => config('backpack.base.route_prefix').'/elfinder', 'middleware' => ['web', 'auth'], //Set to null to disable middleware filter ],

But it doesn't seem to do anything with the config, or the name isn't right. Going to continue installing other modules and see if they have the same issue so I can work out what the config should be.

Work around for now would be to hardcode in admin before it.

'prefix' => 'admin/elfinder',

@AurelDragut
Copy link
Author

Modify the route section in the config/elfinder.php file like this:

'route' => [ 'prefix' => config('backpack.base.route_prefix','/admin').'/elfinder', 'middleware' => ['web', 'auth'], //Set to null to disable middleware filter ],

@unbolt
Copy link

unbolt commented Nov 16, 2016

That just means if the config entry doesn't exist then it falls back to /admin, but the config entry does exist in config/backpack/base.php - the issue is why it isn't being picked up in the elfinder config?

To be accessible it would need to be registered in the ConfigServiceProvider somewhere? Don't know enough about how configs are loaded in Laravel 5 to know if that's been done and just doesn't matter / can't cross-config, or if it's not being done. Presume it must be done as you can access the config variables in blade templates.

@AurelDragut
Copy link
Author

Yes, that is right. They know about it and they will fix it. Till then you can do the same as i did.

@tabacitu
Copy link
Member

Hi guys, I can't replicate the problem. Tried it on a bunch of projects and it worked for me. Also works out of the box if I change the admin prefix from 'admin' to 'administration'.

@AurelDragut , if you didn't get this in your config/elfinder.php file when you published it

    'route' => [
        'prefix'     => config('backpack.base.route_prefix').'/elfinder',
        'middleware' => ['web', 'auth'], //Set to null to disable middleware filter
    ],

it probably means:
A) you published the stock elfinder file, instead of the one in Backpack\Base;
B) you were using an old version of Backpack\Base;

@unbolt , might be a service provider order issue? In you config/app.php, the Backpack service providers should be loaded after the application service providers. Here's mine:

    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Notifications\NotificationServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,

        /*
         * Package Service Providers...
         */

        //

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        // App\Providers\BroadcastServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,


        /*
         * Backpack Service Providers...
         */
        Backpack\Base\BaseServiceProvider::class,
        Backpack\CRUD\CrudServiceProvider::class,
        Backpack\NewsCRUD\NewsCRUDServiceProvider::class,
        Backpack\LangFileManager\LangFileManagerServiceProvider::class,
        Spatie\Backup\BackupServiceProvider::class,
        Backpack\BackupManager\BackupManagerServiceProvider::class,
        Backpack\LogManager\LogManagerServiceProvider::class,
        Backpack\Settings\SettingsServiceProvider::class,
        Backpack\PageManager\PageManagerServiceProvider::class,
        Backpack\PermissionManager\PermissionManagerServiceProvider::class,
        Backpack\MenuCRUD\MenuCRUDServiceProvider::class,
        Backpack\LangFileManager\LangFileManagerServiceProvider::class,

        Barryvdh\Debugbar\ServiceProvider::class,
    ],

Notice the first one is Base, then CRUD.

Does this fix it for you?

Cheers!

@AurelDragut
Copy link
Author

AurelDragut commented Nov 17, 2016

@tabacitu,

i got that in the config file, but i had to add the "backup" value (you know, the one we setup in case we don't have a config/env value at that moment) in order to make it work, just like i wrote to @unbolt. It might be just a matter of "/" considering i added "/admin" and in the config file we have "admin".

Could it be another server issue (just like the one with "enum")?

@zschuessler
Copy link

@unbolt this should work for you:

#191 (comment)

@jaysudodeveloper
Copy link

Has this issue been solved? i seem to be getting the same problem of not being able to access the elfinder from admin/elfinder but i can access it from /elfinder. I've done the installation process twice now and still same problem. adding 'admin' to the prefix in the elfinder config file seems to fix the problem but will only works for the default value in base.php.

@AurelDragut
Copy link
Author

Did you try this?
#233 (comment)

@OwenMelbz
Copy link
Contributor

OwenMelbz commented Dec 4, 2016

Hopefuly you guys have got this sorted now, I'm just closing it to keep it tidy, feel free to carry on if need be! :) if not try out the suggestions #191

This was referenced Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants