Problem/Motivation
When module field_ui is not enabled parent "entity.field_storage_config.collection" is not available leading to a broken menu structure, i.e. menu link gets to be a root item.
Steps to reproduce
- Install modules admin_toolbar, admin_toolbar_tools, field_ui and views_ui.
- Login as admin and check the links are displayed: Reports > Field list > Used in views
- Uninstall module field_ui.
- Check the links 'Field list' and 'Used in views' are not displayed under 'Reports'.
Proposed resolution
Attach the menu link 'Used in views' to the 'Reports' menu item if module 'field_ui' is uninstalled.
Acceptance test
- Install modules admin_toolbar, admin_toolbar_tools, field_ui and views_ui.
- Login as admin and check the links are displayed correctly: Reports > Field list > Used in views
- Uninstall module field_ui.
- Check the links displayed have changed: Reports > Used in views
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork admin_toolbar-3573411
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:
Comments
Comment #2
volkerk commentedWhen module field_ui is not enabled parent "entity.field_storage_config.collection" is not available leading to a broken menu structure, i.e. menu link gets to be a root item.
Comment #4
volkerk commentedComment #5
benstallings commentedLooks good to me!
Comment #7
dydave commentedThanks a lot Volker (@volkerk) for raising this issue and contributing a patch, it's greatly appreciated! 🙏
OK, so if I understand correctly the issue here:
So the added menu link
'Used in views'does not have a parent and does not know where to be attached. 🤔Instead of just not displaying the menu item, could we try attaching it to the
'Reports'menu item?So: the parent of the missing parent?
Reports > Field list > Used in views
Reports > Used in views
It seems the menu link
'Used in views'does not require the 'field_ui' module and its page displays fine when browsing directly to/admin/reports/fields/views-fields.I personally think this could be a better way to mitigate the issue initially reported by trying to degrade the original feature as little as possible.
Therefore, I went ahead and updated the merge request above at #6 with the corresponding logic:
Updated PHPUNIT Tests to check the link would still be displayed when Field UI is uninstalled.
We would greatly appreciate if you could please try testing the updated merge request with the suggested logic and give us your feedback.
At this point, moving ticket back to Needs review, as an attempt to get more feedback and reviews.
Feel free to let us know if you have any questions on this comment, the suggested logic or the changes in the merge request, we would certainly be glad to help.
Thanks in advance!
Comment #9
dydave commentedThis issue has been pending review and testing for more than 3 months now....
After doing another quick round of tests locally and reviewing the code changes, since all the tests and jobs were still passing 🟢, I went ahead and merged the changes above at #8 🥳
At this point, all the work to be carried in this issue should have been completed, thus, marking it as Fixed for now. 👍
Feel free to let us know if you have any questions or concerns on any of the recent code changes or the module in general, we would surely be glad to help.
Thanks again for your help! 🙏