Problem/Motivation

The MyAccountMenuLink plugin class is being added to core in #2256521: [META] New plan, Phase 2: Implement menu links as plugins, including static admin links and views, and custom links with menu_link_content entity, all managed via menu_ui module

However, it uses the hidden property to toggle visibility off for anonymous users.

This is not a good idea - hidden should be a strictly static value, not dynamic. This really becomes an issue as we start to implement render caching.

Proposed resolution

re-write this as a link to user.view with dynamic route parameters to affect access since hidden should not be dynamic, but access can be.

The current use of /user has been very problematic in the past. The path 'user' must be accessible for anonymous users, but only visible for authenticated users. Authenticated users should see "My account", but anonymous users should not see it at all.

Remaining tasks

User interface changes

My account link will link directly to user's account (user/$uid), instead of just /user

API changes

N/A

postponed on #2250315: Regression: Bring back node access optimization to menu trees which will add back methods to get the route name and parameters.

CommentFileSizeAuthor
#3 user_me.patch5.86 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Status: Postponed » Active

This is important to get done to enable render caching

dawehner’s picture

FileSize
5.86 KB

One idea could be to basically bring me module into core in a really small way. It would allow you to link
to user/me directly and replace it on the incoming request.

dawehner’s picture

Status: Active » Fixed

Great! Let's drop that issue then.

Status: Fixed » Closed (fixed)

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