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

  1. Install modules admin_toolbar, admin_toolbar_tools, field_ui and views_ui.
  2. Login as admin and check the links are displayed: Reports > Field list > Used in views
  3. Uninstall module field_ui.
  4. 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

  1. Install modules admin_toolbar, admin_toolbar_tools, field_ui and views_ui.
  2. Login as admin and check the links are displayed correctly: Reports > Field list > Used in views
  3. Uninstall module field_ui.
  4. Check the links displayed have changed: Reports > Used in views

Remaining tasks

User interface changes

API changes

Data model changes

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:

Comments

volkerk created an issue. See original summary.

volkerk’s picture

Title: Do not add field_ui related view_ui menu link when module is not enabled » Do not add field_ui related views_ui menu link when module is not enabled

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.

volkerk’s picture

Status: Active » Needs review
benstallings’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

dydave made their first commit to this issue’s fork.

dydave’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review

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

When module field_ui is not enabled parent "entity.field_storage_config.collection" is not available

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:

  • Field UI installed: Reports > Field list > Used in views
  • Field UI uninstalled: Reports > Used in views

 
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!

  • dydave committed ddaf98c6 on 3.x authored by volkerk
    Issue #3573411 by dydave, volkerk: Gracefully degrade 'field_ui' module...
dydave’s picture

Status: Needs review » Fixed

This 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! 🙏

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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