Hi,
It's the first time that I use this module in drupal 8 and I don't see a tab to browse files when I am logged in my profile page.

In drupal 7, The tab was active. What must I do to see these tab in drupal 8 ? I don't see specific permission and no settings in the admin page of the module

Related issues:
#3131399: Implements controller to FIle Brower tab
#3131403: Add css class to style the page /admin/imce/browser

Issue fork imce-2858430

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixelpreview created an issue. See original summary.

johnpicozzi’s picture

Hello, 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.

pcranston’s picture

The 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.

rutiolma’s picture

Status: Active » Needs review
FileSize
252 bytes

I'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.

zalak.addweb’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
49.08 KB
50.51 KB

@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.

Shane Birley’s picture

This 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.

sopranos’s picture

can 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

Christopher Riley’s picture

Can this get committed?

ccshannon’s picture

Though 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

    "extra": {
        "patches": {
            "drupal/imce": {
              "Add User Browser Tab" : "https://www.drupal.org/files/issues/imce_no_browser_tab-2858430-4.patch"
            },
        },
    },

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.

Christopher Riley’s picture

Yes 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.

ccshannon’s picture

@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.

thalles’s picture

Hi everyone, give permission to users on::
Administration >> Configuration >> Media >> imce file manager

thalles’s picture

Issue summary: View changes
FileSize
67 KB

The 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:

thalles’s picture

Status: Reviewed & tested by the community » Needs work
thalles’s picture

Hi @ufku, is there any easy way to put this in a default drupal admin template?

thalles’s picture

Status: Needs work » Fixed
rutiolma’s picture

Status: Fixed » Active

@thalles, how was this fixed and on which version?
I don't see any commits on dev branch.

thalles’s picture

Sorry @rutiolma!
Can you send a patch to evaluate?

thalles’s picture

Status: Active » Needs work
thalles’s picture

The link to this page can be finded in admin/config/media/imce
@see:

thalles’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

thalles’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work
thalles’s picture

Follow a patch

  • thalles committed 109d703 on 8.x-2.x
    Issue #2858430 by thalles, rutiolma, pcranston, Pranjal.addweb: no...
thalles’s picture

Status: Needs review » Fixed
FileSize
50.24 KB
109.87 KB

Commited in dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hatuhay’s picture

I am having trouble with #24 patch as the correct route name seems to be imce.page
Did that change and everything worked OK

robbt’s picture

Yeah 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.

Sseto’s picture

Any 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!

ufku’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Component: Documentation » Code
Category: Support request » Feature request
Status: Closed (fixed) » Needs work

The 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.

paulocs’s picture

On it.

paulocs’s picture

Assigned: Unassigned » paulocs

paulocs’s picture

Assigned: paulocs » Unassigned
Status: Needs work » Needs review

Created a MR for this issue.
I created a new class ImceLocalTasks to dynamically create the local task based on the imce user profile.

ufku’s picture

@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

paulocs’s picture

I'm trying to change the local task route_name to imce.user_browser so 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.

paulocs’s picture

In /admin/config/media/imce it works but it does not work on the user page...

paulocs’s picture

Assigned: Unassigned » paulocs

I found a solution and I'll update the MR.

paulocs’s picture

Assigned: paulocs » Unassigned

Updated the MR.

@ufku, if possible, can you please credit @gabrielabdalla? He helped me resolving the bug #37.

Cheers, Paulo.

ufku’s picture

@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...

paulocs’s picture

Issue summary: View changes
FileSize
95.69 KB

are you sure this displays the imce page in an iframe?

Yes, check the image below.

Also not sure if we need the deriver ImceLocalTasks.

I created it, because if the User IMCE Profile has not the usertab configuration checked, the local task should not be displayed. Its possible to do that, using the hook_local_tasks_alter as well. ImceLocalTasks.php does that verification and dynamically creates the local task or not based on that configuration.

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.

There is already a controller that returns the IMCE rendered in a frame. Its the controller ImceAdminBrowserController.php.

Cheers, Paulo.

ufku’s picture

Did you try it with a normal user?

imce.user_browser requires '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 the ImceAdminBrowserController if it's going to be used as a common controller for users and admins.

paulocs’s picture

Assigned: Unassigned » paulocs
paulocs’s picture

Assigned: paulocs » Unassigned

Addressed #43.

  • ufku committed 3caab69 on 8.x-2.x authored by paulocs
    Issue #2858430 by paulocs: Add local task for IMCE to the user profile...

  • ufku committed 655c745 on 8.x-2.x
    Issue #2858430: Fixed user/x/imce access check
    
    Prevent users access...
ufku’s picture

Status: Needs review » Fixed

Committed the MR, thanks.

Also fixed an issue where users can access other user's tabs.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

matpiet’s picture

Is 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.