- Issue created by @adrianm6254
- πΊπΈUnited States adrianm6254
I did try admin_toolbar 3.5.2 but that had no effect on my issue.
- First commit to issue fork.
- Merge request !117Issue #3506824 by dydave: Fixed compatibility with Project Browser following... β (Merged) created by dydave
- π«π·France dydave
Great catch Adrian (@adrianm6254)! Thanks a lot for reporting this issue!
Given the popularity of the
admin_toolbar
module, we would definitely like it to be compatible with Project Browser β , as much as possible.This was definitely not an easy one ... took some thinking to wrap my head around the issue and try to find an appropriate solution that wouldn't add any sort of dependency to Project Browser.
Created an initial merge request at #4, which should be pretty much good to go.
It just lacks automated tests, but I'm not sure we would really want external integrations to be systematically tested. This would probably complicate the GitLab CI configuration.... But would be doable if it's really required.Otherwise:
The Project Browser now uses routes pointing directly to specific sources defined as module's Plugins (Sources), see for example:
https://git.drupalcode.org/project/project_browser/-/blob/2.0.x/src/Plug...Based on what was done for entity menu items, for example, Add Media types :
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...
using the Menu Link helper classDrupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity
, see:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...I created a similar class
MenuLinkPlugin
allowing to extract a title and a description for a given plugin passed in themetadata
fields of the menu link plugin.
This would allow to dynamically generate routes for any other modules using the same type of plugin structure for its routes.The previous code was modified directly, meaning that once these changes are committed, previous versions of Project Browser will not be compatible anymore ==> Require an upgrade, which "should" be acceptable (?!).
Added Project Browser settings form submit handler to rebuild menu items when changes are made to enabled sources:
In other words: When enabled sources are changed at/admin/config/development/project_browser
, the changes will be immediately reflected in the Admin Toolbar menu.Since the tests are all still passing π’ moving issue to Needs review.
Feel free to let us know if you have any questions or concerns on any of the suggested changes, this ticket or the project in general, we would certainly be glad to help.
Thanks in advance! I was facing same issue while installing Project browser when I had admin toolbar enabled https://www.drupal.org/project/project_browser/issues/3499630 π Some mandatory parameters are missing ("source") to generate a URL for route "project_browser.browse" Active
I tried the above MR MR for admin toolbar and error is not coming anymore.Hence, I am moving this to RTBC, thanks.
- Status changed to RTBC
9 days ago 6:10pm 11 May 2025 -
adriancid β
committed cbaf1aa1 on 3.x authored by
dydave β
Issue #3506824 by dydave: Fixed compatibility with Project Browser...
-
adriancid β
committed cbaf1aa1 on 3.x authored by
dydave β