Closed (fixed)
Project:
IMCE
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2017 at 13:11 UTC
Updated:
30 Sep 2021 at 22:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
johnpicozziHello, I was also wondering where the "File Browser" tab on the user profile went.
After some looking without finding anything in the documentation (other than this post) or the admin I put a work around in place. It's pretty easy, just create a menu item that goes to /imce.
Hope this helps and gets addressed soon.
Comment #3
pcranston commentedThe preferred D8 way to do this would be by adding a links.task.yml file to the module, no? The attached patch will do so. The task system will already account for permissions, and won't add the tab to users without a role that has access to IMCE.
Comment #4
rutiolmaI've done a small update to @pcranston patch so it can be applied properly.
It would be nice to have this as a modal or as an iframe like on D7.
Comment #5
zalak.addweb commented@rmarques, Thanks for the patch, it is a good issue which resolves with this attached patch, I Checked it using simplytest.me & Works for me. PFA as a current result.
Comment #6
shane birley commentedThis works pretty good except for the fact it isn't being loaded modally or iframed (as mentioned before). Just getting up to speed on how this will all function within the D8 world.
Comment #7
sopranos commentedcan somebody put this in latest release???
I mean this module aint working properly if you have to patch it......
version 7 worked fine, version for Drupal 8 looks like it is missing 50% of features
Comment #8
Christopher Riley commentedCan this get committed?
Comment #9
ccshannon commentedThough it's nice to have a stable, full-featured release, just want to point out that you can very much run a composer-based workflow with patches that automatically get applied to modules when running composer install or composer update.
In your composer.json
This is a non-destructive way of changing core or contrib code without directly hacking or having to worry about overwriting patched code and losing the changes. It works until the maintainers change the code. When you run composer locally, or on a Dev server, and the patch fails, you just remove the reference from composer.json.
Comment #10
Christopher Riley commentedYes I am aware of how patches work and granted on a single or even just a couple of sites its not a nightmare to manage however when you have multiple sites to manage and or starting new sites its a royal pain to keep track of adding patches across the board. My thinking on patches is that either the lead developer should accept patches and review them in a timely fashion and decide to either include, enhance it or say no way within a few months at max. I know many developers are busier than a one armed wall paper hanger however on some projects a patch has been RTBC for almost a year.
In this time where Drupal adoption of D8 is up and down as the wind blows the more on the ball we are the better off I think the community will be.
Just my two-cents and I will step off my podium now.
Comment #11
ccshannon commented@Christopher Riley I agree with you 100%, but just want the general audience, those people who search issue threads for solutions but may not be aware, that they can manage patches without overwriting them with an update.
That said, yes, I agree the ideal situation is for these useful patches to be adopted to a release. In the absence of ideal situation, where the maintainers are bogged down with other matters or have walked away, there is always the workaround.
Comment #12
thallesHi everyone, give permission to users on::
Administration >> Configuration >> Media >> imce file manager
Comment #13
thallesThe patch works, but I'm not convinced a response should be this, we could have something with the template of the moment.
Response after click:

Comment #14
thallesComment #15
thallesHi @ufku, is there any easy way to put this in a default drupal admin template?
Comment #16
thallesComment #17
rutiolma@thalles, how was this fixed and on which version?
I don't see any commits on dev branch.
Comment #18
thallesSorry @rutiolma!
Can you send a patch to evaluate?
Comment #19
thallesComment #20
thallesThe link to this page can be finded in admin/config/media/imce
@see:
Comment #21
thallesComment #23
thallesComment #24
thallesFollow a patch
Comment #26
thallesCommited in dev branch.
Comment #28
hatuhay commentedI am having trouble with #24 patch as the correct route name seems to be imce.page
Did that change and everything worked OK
Comment #29
robbt commentedYeah I can confirm that this patch no longer works with the latest code.
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "imce.file_browser" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).I tried changing the route to imce.page and while I did see a file browser at site-url/imce it didn't seem to display the actual files only the folder structure.
Comment #30
sseto commentedAny update on this? When I go /imce, I get a blank page...
*EDIT: In order to fix the blank page, you need to go `/admin/config/media/imce` > Scroll all the way down to "Common settings" > Click "User admin theme for IMCE paths" > drush cr.
But You also need to do what #28 and #29 and change the route to imce.page to work. Can someone update the patch to fix the route please?
Thank you!
Comment #31
ufku commentedThe original post is about getting user/x/imce tab, which must be implemented in a way similar to Drupal 7.
A config option(Enable user tab) in IMCE profile and a menu callback that checks if the user tab enabled in user's IMCE profile.
Comment #32
paulocsOn it.
Comment #33
paulocsComment #35
paulocsCreated a MR for this issue.
I created a new class
ImceLocalTasksto dynamically create the local task based on the imce user profile.Comment #36
ufku commented@paulocs thanks for the patch. Is it possible to make user/x/imce path display an iframe pointing to /imce path. This is how it's done in Drupal 7
Comment #37
paulocsI'm trying to change the local task route_name to
imce.user_browserso it can be displayed in a frame but I get the error:Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("user") to generate a URL for route "shortcut.set_switch". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of core/lib/Drupal/Core/Routing/UrlGenerator.php).Its not a very clear error.
Comment #38
paulocsIn
/admin/config/media/imceit works but it does not work on the user page...Comment #39
paulocsI found a solution and I'll update the MR.
Comment #40
paulocsUpdated the MR.
@ufku, if possible, can you please credit @gabrielabdalla? He helped me resolving the bug #37.
Cheers, Paulo.
Comment #41
ufku commented@paulocs: are you sure this displays the imce page in an iframe?
Also not sure if we need the deriver
ImceLocalTasks.What we need is user/x/imce route with its own controller that prints an iframe pointing to /imce path. The access check must be similar to the /imce route.
See https://stackoverflow.com/questions/52740007/create-custom-menu-tab-on-a...
Comment #42
paulocsYes, check the image below.

I created it, because if the User IMCE Profile has not the
usertabconfiguration checked, the local task should not be displayed. Its possible to do that, using thehook_local_tasks_alteras well.ImceLocalTasks.phpdoes that verification and dynamically creates the local task or not based on that configuration.There is already a controller that returns the IMCE rendered in a frame. Its the controller
ImceAdminBrowserController.php.Cheers, Paulo.
Comment #43
ufku commentedDid you try it with a normal user?
imce.user_browserrequires 'administer imce' permission. I think it should instead use a custom access handler that checks the usertab config in the profile, which would eliminate the need for the deriver. We my also consider renaming theImceAdminBrowserControllerif it's going to be used as a common controller for users and admins.Comment #44
paulocsComment #45
paulocsAddressed #43.
Comment #48
ufku commentedCommitted the MR, thanks.
Also fixed an issue where users can access other user's tabs.
Comment #50
matpiet commentedIs there a timeline for when this feature will be added to the main source? I am not trying to reinvent the wheel since it looks like you have a solution out there for the tab to appear on the user profile. I am using drupal 9 though.