Problem/Motivation

Started encountering exceptions with Menu Link Manipulator module after installing and creating Contexts.

See this thread: https://www.drupal.org/project/menu_manipulator/issues/3251675#comment-1...

Why does the Context UI module create MenuLinkContent to represent access to a Context? They are configuration entities, can they not be listed on the admin page with an EntityListBuilder?

Patching in the change on that comment above fixes the issue in that particular module, but this could be the source of heisenbugs for other users of Context/Context UI when used in conjunction with modules that use their own menu tree manipulators or add on to the core menu tree manipulator process.

CommentFileSizeAuthor
#9 after-update.png8.04 KBlucassc
#9 before-update.png12.83 KBlucassc

Issue fork context-3280556

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

kevinquillen created an issue. See original summary.

paulocs’s picture

Category: Support request » Task

I think we can remove this functionally. It's not common to create new menu links as I see in other modules. There is already the context list page to list all contexts.
I'll work on it.

randalv’s picture

I can post this in a new issue too, but seeing as the developer said they'll remove the functionality I figured this would be the right place to post this to.

Installing context_ui and creating a new context without have menu_link_content installed throws an error:

Message	Error: Class "Drupal\menu_link_content\Entity\MenuLinkContent" not found in Drupal\context_ui\MenuBuilder->addSubMenuItem() (line 52 of /app/web/modules/contrib/context/modules/context_ui/src/MenuBuilder.php)
#0 /app/web/modules/contrib/context/modules/context_ui/context_ui.module(12): Drupal\context_ui\MenuBuilder->addSubMenuItem(Object(Drupal\context\Entity\Context))

So, if we don't remove this functionality, we should at least make menu_link_content a dependency for context_ui :-)

paulocs’s picture

Status: Active » Needs review

I have also created an update hook to remove all content links that are child of entity.context.collection menu.

lucassc’s picture

Assigned: Unassigned » lucassc
lucassc’s picture

Assigned: lucassc » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi!

Good to remove this functionally, I don't think it's very common either.

I created a new context without any conditions or reactions in branch 8.x-4.x-dev and the menu link was created in /admin/structure/menu/manage/admin (see before-update.png), then I checked out the MR !30's branch, accessed /update.php to run the update hook in #5 and the menu link was removed (see after-update.png).

I think it can be moved to RTBC.

paulocs’s picture

Hey @RandalV and @kevinquillen, would you like to double check my solution?
I think its okay to create an update hook to remove all content links that are child of entity.context.collection menu.

lucassc’s picture

StatusFileSize
new12.83 KB
new8.04 KB

Attaching before x after screenshots.

  • paulocs committed 86f2ca4 on 8.x-4.x
    Issue #3280556 by paulocs, lucassc: Why does Context UI module create a...
paulocs’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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