Closed (fixed)
Project:
Admin Toolbar
Version:
3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2021 at 15:23 UTC
Updated:
14 Oct 2022 at 13:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
paulocsComment #3
paulocsComment #5
rkollerthanks for the merge request! i've applied the diff to version 3.0.3 first and cleared caches. but unfortunately no menu link for
manage permissionsis showing in the admin menu. changed the admin_toolbar version to 3.0-dev afterwards and reapplied the patch plus cleared the caches on the drupal 9.3.0 alpha1 but same outcome. :( checked content types, media types, taxonomies and storage types (i have the storage module installed which provides custom entities). also checkedadmin/structure/menu/manage/adminand themanage permissionsmenu links also aren't showing there.p.s. shall i test with version 3.0.3 or preferably 3.0-dev from now on for this issue?
Comment #6
paulocsStrange because i checkout the branch i worked on, clear the cache and its working to me. I created the MR based on the 3.x branch.
Are you sure you are using 9.3.0-alpha1?
It should work after you applied the patch and clear the cache... Did you try to clear your browser cache as well?
PS: sorry for the image quality.
Comment #7
beatrizrodrigues@rkoller I just tested and the menu is showing to me. I was taking some screenshots to attached
Comment #8
beatrizrodriguesI tested at a version before drupal 9.3.0-alpha and all worked fine (i'm mean, nothing is broken), and the menu is showing at drupal 9.3.0-alpha. As you can see at the screenshot above.
Comment #9
beatrizrodriguesWell, as all seems fine to me, i'm moving to RTBC.
Comment #10
paulocsSorry for set back to NR @beatrizrodrigues, but as @rkoller opened the issue, lets see he will be able to use the new feature as well.
Comment #11
beatrizrodriguesOw, no problem. I didn't think of this. Thank you for this!
Sorry for the crazy changing of status here, folks
Comment #12
beatrizrodriguesComment #13
rkollerthat really really strange. i've used
drush crseveral times, cleared the cache globally in the developer menu in safari as well alt clicked the reload button. also tried with claro as well as seven as admin theme (always adrush crafterwards). also restarted my local instance in ddev. really tried to iron out each and every possible detail i could think of. also tried another round ofcomposer update drupal/admin_toolbar -wbut no update found. and the submenu links still dont show up as you can see in the three linked images underneath:the only thing left i could think of for the moment that some other module is interfering in some mysterious way. will uninstall all other non core modules stepwise and clear caches each time and see if the menu links are showing up like for you two. :/ if you have any other suggestions i might try i am all ears. oh and i also checked the source that the patch got applied. i can confirm it was.
Comment #14
paulocsAre you logged in as an admin user? (I'm asking because my last shot is that your user does not have the permission to access the permission form)
Comment #15
rkollerhm i have only the initially created admin user i am logged in with on that install and the active roles for that user are "authenticated user", "content editor" and "Administrator". :/ maybe i try to install a fresh install of alpha1 and install directly admin_toolbar dev version and apply the patch and see if it works then.
Comment #16
rkollercreated a completely new project (i use an ansible script for that to keep it reproducible and automated - could upload that in here as well). but same result unable to see the submenu link :( the last thing i might think of is the syntax for the patch in the composer.json. in the extra section i've added the following bit ( but i doubt that that is the reason.
but aside that i am out of ideas (am not a programmer) :(
Comment #17
paulocsdid you check if the source code was changed after apply the patch with composer?
Comment #18
rkolleryep i already mentioned in #13 that i checked if the diff changes got actually applied to the codebase. rechecked now again and all changes in
admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.phpgot applied. :/ i'll add the file that you are able to compare and diff it with your working one (just had to rename the suffix from php to txt since php is not allowed)Comment #19
paulocsoh i see... I really don't know the problem, sorry.
Comment #20
rkollerI'be brought up the issue at the austin drupal dojo last night. @rocketeerbkw helped narrowing down what is causing the issue. he installed the patch on simplytest me and it worked like when you two tested it. then we commented out the following two lines on my failing installation
as well as the associated closing curly bracket. after that step the manage permissions tab showed up instantly as well as the menu links in the administration menu.
one observation and question about that detail. if you go to
admin/people/permissionsand take a look at the available field ui permissions you have permissions foradminister display,administer fields,administer form displayforcontent,custom blocksandtaxonomybut none related toadminister permissionsthere? while in theExtraLinks.phpall the snippets building the "manage..." tabs have no permission checks except the snippet you introduced in the merge request. so is the permission check necessary at all there? and on the other hand would the manage permissions tab need anadminister permissionspermission in the field ui section. perhaps we could ask @benji about that - the driving force behind the introduction of the manage permission tab.i've then reverted the commented out lines back to the initial state of your patch and then we started comparing what is the difference between @rocketeerbkw simplytestme install and my failing one. at least we had an idea that it might be permission related. @rocketeerbkw also noted that when he installed simplytestme he just installed
admin_toolbarandadmin_toolbar_toolsstepwise. when i setup a site testing i've automated everything with ansible and idrush enadmin_toolbarandadmin_toolbar_toolsas well asadmin_toolbar_links_access_filterat once. since i've been sensitised that it might be a permission related cause i've noticed thatadmin_toolbar_links_access_filtermodule description statesi've created a new test site manually and composer required
admin_toolbarand installed its modules stepwise afterwards. firstadmin_toolbarandadmin_toolbar_tools. there themanage permissionstab was showing up properly. but as soon asadmin_toolbar_links_access_filterwas installed the tab disappared. if you uninstall it again the tab as well as the menu links in that administration menu are showing up again. i don't know the exact why but at least i found the root causing it. hope that helps? :)Comment #21
paulocsYes, I added the verification mentioned in #20 because its created for every bundle a permission form but not all of them has a real per bundle permission. One example is the comment entity bundle. So if you are logged in as an admin user, even if you install
admin_toolbar_links_access_filter, a "Manage permissions" link will be created that will redirect you to a permission denied page because of:See the image attached if i remove the verification. Note that the link is displayed for admin users only...
I only don't know how you can not see the 'Manage permissions' link. I was able to see it even with the
admin_toolbar_links_access_filtercreated. Are you testing it in a custom content type? Does the content type have bundle permission?Comment #22
rkollerthat is really strange. i've updated
admin_toolbaron my new 9.3.0 beta1 installation to 3.x-dev and applied the diff. on that install i had onlyadmin_toolbarandadmin_toolbar_extra_toolsinstalled. started to make screenshots to demonstrate with those two modules installed everything is working as expected. i then installedadmin_toolbar_links_access_filterto demonstrate the effect i've described in #20. did adrush crseveral times as well as cleared the browser caches once or twice. but somehow it is working now?!i am able to see the manage permissions menu link for content types, media types, taxonomy types (Added and example screenshot for the article content type). but for comment types you showed the example for i am not able to. same for contact forms. not sure if contact forms are expected to have the manage permissions tab. same goes for the comment types. but there it should be supported since you've added a screenshot for them?
and i am testing the drupal 9.3.0beta1 with admin_toolbar 3.x-dev as admin user. and i havent tried anything non core.
Comment #23
rkollerit is really really strange. installed coffee ( composer require 'drupal/coffee:^1.2 ) after i've posted the comment. wanted to try if i am able to reach the manage permissions tabs as well. on drush en coffee i got:
[warning] Entity view display 'node.article.default': Component 'comment' was disabled because its settings depend on removed dependencies.
[warning] Entity view display 'node.forum.default': Component 'comment_forum' was disabled because its settings depend on removed dependencies.
[success] Successfully enabled: coffee
cleared caches. reloaded and then that (see screenshot coffee_article_content_type.png). if i uninstall coffee, clear caches the behavior is back to like described in #22 (see article_content_type.png in #22). really confusing :/
Comment #24
paulocscomment types have no bundle permission. With the MR created, you can not see it. That is why i added the URL access check.
Comment #25
rkollerahhh okay. was uncertain for a second. thanks for the clarification! then the patch works as expected. shall i set the status to rtbc? cuz there is still the behavior by the coffee module. not sure if that is an issue on the admin_toolbars end related to this issue here or if it is more of a coffee module issue. i've just mentioned it in here because i've noticed while testing and the effect is the exact same like i've experienced with this issue?
Comment #26
paulocsI tested with the coffee module enabled and I didn't find any problem...
I have
admin_toolbar,admin_toolbar_links_access_filter,admin_toolbar_toolsandcoffeeenabled.Comment #27
rkollerthats odd and confusing. i haven't changed anything at all to the time i've tested and wrote answer #27 but the sub menus links are showing up now again. that really confusing. and i am really unable to reproduce nor able to figure what was causing it. but i have the same four modules installed and everything is working. thanks a lot for the fix and your patience following along providing suggestion for possible causes. :) set it to rtbc now.
Comment #28
romainj commentedComment #29
romainj commentedI'm sorry but I think that there is another problem here.
What is working:
- for Drupal Core before 9.3.0-alpha1 version, everything is working fine. We have no links as expected.
- for Drupal Core since 9.3.0-alpha1 version, it's not always displaying the links! In fact if you clear the cache using Drupal UI, it's fine. But clearing the cache using Drush (10.6.2) it does not work: no links at all.
I think the problem is that we are testing access of the current user before adding those links. So with Drush, no Drupal user, no links. When I commented out this test, it's working fine. We have to check access before displaying those links but not when defining them.
Can anyone else confirm the bug?
Comment #30
WagnerMelo commentedHi, i'll try work on this issue, and confirm the bug that @romainj tell on #29.
Comment #31
WagnerMelo commentedHello, i tryied work in this issue, first i tryied confirm the bug mentionated in #29 per @romainj, and i discovery that the patch only works on drupal version 9.3.0.alpha-1, only work in this exactly version, i created another two environments with drupal in version 9.4.2 and 9.2.9, and i this two enviroments i couldn't be able to displaying the extra links of manage permission.
I would like to help more but i'm don't have the knowledge enought to fix this issue, i hope that i has helped with this information.
Comment #32
victorml commentedI'll try to work on this issue.
Comment #33
victorml commentedThe dynamic routes creation for the permissions forms changed with the release of Drupal 9.4, you can check on the following issue:
#3253955: Let modules opt in to the bundle-specific permissions form
We've updated the route so this feature works according to the changes.
The feature will work only from drupal 9.4 and above.
To test the feature, the cache must be cleared using the interface. (explanation on comment #29)
Comment #34
lucasscComment #35
lucasscHi!
I confirmed what @victorml said in #33:
The route subscriber was replaced with a route provider and the feature now is targeting 9.4.x. The permissions_form (plural) was also tweaked in this commit.
I checked out 3247913-add-a-menu branch for drupal 9.4.6-dev and flush all caches by the site. Everything worked well (attaching before/after screenshots).
Leaving status as "Needs Review" for those who had problems before check it again.
Comment #36
lucasscComment #37
Anonymous (not verified) commentedHello,
I've been testing the work done on this issue with Drupal 9.5.x-dev Php8.1 and the dev version of this module with the work done by the #32. After enabling the module I can confirm that the "Manage permissions" links appear in the appropriate places as was already confirmed by the #35. Leaving this as it needs review for the same reason as #35.
Comment #38
lucasscI think it can be marked as RTBC If no one else disagrees.
Comment #39
romainj commentedThanks to all. My comment #29 is still relevant. You must clear the cache using the UI in order to get the new menu links. Doing the cache rebuild using drush command is not working. To me this is a blocking problem. I will work on this.
Comment #40
romainj commentedI think that we do not need to check access to the permissions route here. It's automatically done by drupal Core. When we do not check access then everything is working fine: all permissions menu links are visible after cache rebuild (both via UI or Drush) and it respect permission access of the user (Administer roles and permissions).
Comment #44
romainj commented