i have successfully install the system but while i am clicking the elfinder menu then i get 404 error.
Hi @shankhadevpadam ,
I can't seem to get the same results. Could you please give me a few details about your setup?
Thanks!
ubuntu 16.04 with lamp environment (php 7.0.8)
@tabacitu I confirm the presence of this bug.
windows, built-in web server, php 5.6, php 7. works
debian, php 5.6.24 - bug.
Config elfinder:
'prefix' => config('backpack.base.route_prefix').'/elfinder',
return '/elfinder' instead '/admin/elfinder'
app.php
...
Backpack\Base\BaseServiceProvider::class,
Backpack\CRUD\CrudServiceProvider::class,
Backpack\Generators\GeneratorsServiceProvider::class,
Backpack\LangFileManager\LangFileManagerServiceProvider::class,
Backpack\LogManager\LogManagerServiceProvider::class,
...
I'm running on PHP 7.0.8-0ubuntu0.16.04.3, and I have the exact same problem as the OP. I followed the install instructions for base and crud to the T, I added the menu item to the sidebar, clicked on it, and as a result get to see a 404.
Config elfinder:
'prefix' => config('backpack.base.route_prefix').'/elfinder',
I can confirm, adding a default value of admin returns the correct path:
'prefix' => config('backpack.base.route_prefix').'/elfinder', => returns '/elfinder'
'prefix' => config('backpack.base.route_prefix', 'admin').'/elfinder', => returns '/admin/elfinder'
but it will not work for "other" route_prefix.
Damn it! So Debian and Ubuntu seem not to allow cross-use configs... I was hoping this would solve it but apparently no. Please use this temporary fix in your projects until we find a more permanent solution:
Manually set your route.prefix in your config/elfinder.php file:
'route' => [
'prefix' => 'admin/elfinder',
'middleware' => ['web', 'auth'], //Set to null to disable middleware filter
],
I'll install an Ubuntu and see what the problem is. Thanks a lot for reporting this, everyone. Cheers!
This one work.
Hi @tabacitu I have the same issue - I get a 404 but the routes are there - I am pulling my hair out.
On my local vagrant box
PHP 7.0.8-2+deb.sury.org~xenial+1
This works
'route' => [
'prefix' => config('backpack.base.route_prefix').'/elfinder',
'middleware' => ['web', 'auth'], //Set to null to disable middleware filter
],
On my live server
PHP 7.1.0-5+deb.sury.org~xenial+1
I had to change it to this to get the routes to work
'route' => [
'prefix' => 'admin/elfinder',
'middleware' => ['web', 'auth'], //Set to null to disable middleware filter
],
But even though the routes show I still get a 404
| | GET|HEAD | admin/category/{id}/translate/{lang} | crud.category.translateItem | Backpack\NewsCRUD\app\Http\Controllers\Admin\CategoryCrudController@translateItem | web,admin,Closure |
| | GET|HEAD | admin/dashboard | | Backpack\Base\app\Http\Controllers\AdminController@dashboard | web,admin |
| | GET|HEAD | admin/elfinder | | Barryvdh\Elfinder\ElfinderController@showIndex | web,auth |
| | GET|HEAD | admin/elfinder/ckeditor | elfinder.ckeditor | Barryvdh\Elfinder\ElfinderController@showCKeditor4 | web,auth |
| | GET|HEAD|POST|PUT|PATCH|DELETE | admin/elfinder/connector | elfinder.connector | Barryvdh\Elfinder\ElfinderController@showConnector | web,auth |
| | GET|HEAD | admin/elfinder/filepicker/{input_id} | elfinder.filepicker | Barryvdh\Elfinder\ElfinderController@showFilePicker | web,auth |
| | GET|HEAD | admin/elfinder/popup/{input_id} | elfinder.popup | Barryvdh\Elfinder\ElfinderController@showPopup | web,auth |
| | GET|HEAD | admin/elfinder/tinymce | elfinder.tinymce | Barryvdh\Elfinder\ElfinderController@showTinyMCE | web,auth |
| | GET|HEAD | admin/elfinder/tinymce4 | elfinder.tinymce4 | Barryvdh\Elfinder\ElfinderController@showTinyMCE4 | elfinder.tinymce4 |
I can't figure this out - do you have any advice?
Hi @seandowney currently theres no known fix apart from the which @tabacitu previously mentioned.
There seems to be some ubuntu issues, which will need to be investigated in the future.
Unless you're expecting to change the admin url its fine to hard code the route, maybe add it to the documentation for your project so other people know to change the config manually if you ever change the url.
@OwenMelbz thanks for coming back to me.
Really strange, the url is working now.
I can't explain it - but it's not an issue now.
Thanks for a great project and the fast reply.
@seandowney well this will make it even more interesting to debug :-))
I think it might have been an issue with opcache rather than anything in Backpack.
So you can ignore my part in this thread :-)
鈦hanks
On 8 Jan 2017 8:41 AM, at 8:41 AM, Cristian Tabacitu notifications@github.com wrote:
@seandowney well this will make it even more interesting to debug :-))
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/Laravel-Backpack/CRUD/issues/311#issuecomment-271138353
@tabacitu Manually set your route.prefix in your config/elfinder.php file:
This fixed it for me.
Thank you!
Looks like that the issue has been reproduced for now...
It helped for me:
// app/Providers/AppServiceProvider.php
public function register()
{
// Other code...
$this->backpackDuctTape();
}
/**
* Set some config options for Backpack
* that can't be setted in the configuration files.
*
* @return void
*/
protected function backpackDuctTape()
{
\Config::set('backpack.base.user_model_fqn', \App\Models\Auth\BackpackUser::class);
\Config::set('elfinder.route.prefix', 'admin/elfinder');
}
I tried to place this code in my service provider, and also put the provider first in the list of service providers (before AppServiceProvider in config/app.php). It did not help me anyway.
Still haven't been able to replicate this myself - and I have no idea why some systems behave so, others don't. Thank you for the solution @NewEXE - I'm sure someone will find it useful. I don't think it's something we could implement in the package itself, though, since it's hard-coding the config values. But it should work fine for individuals who encounter this issue.
Most helpful comment
Damn it! So Debian and Ubuntu seem not to allow cross-use configs... I was hoping this would solve it but apparently no. Please use this temporary fix in your projects until we find a more permanent solution:
Manually set your route.prefix in your
config/elfinder.phpfile:I'll install an Ubuntu and see what the problem is. Thanks a lot for reporting this, everyone. Cheers!