Closed (fixed)
Project:
Menu Token
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
25 Jul 2017 at 14:21 UTC
Updated:
16 Apr 2018 at 07:26 UTC
Jump to comment: Most recent
When I have used the Menu Token [current-user:account-name] for users , I have to flush all caches to display user name (capture.png)
when I log in with an other user, the name (name of previous user ) doesn't change. (capture2.png)
If I flush the cache with drush the name is empty. (capture3.png)
| Comment | File | Size | Author |
|---|---|---|---|
| Capture3.PNG | 25.85 KB | imen ch | |
| Capture2.PNG | 22.68 KB | imen ch | |
| Capture.PNG | 35.81 KB | imen ch |
Comments
Comment #2
znak commentedComment #3
znak commentedI can't reproduce your problem. On my site it's work fine. Please, need more info.
Comment #4
imen ch commentedDo you have logged in with authenticated user or admin?
Do you have the correct name when you change the user?
For me it works only for admin after flushing all caches via drupal backoffice.
Comment #5
imen ch commentedComment #6
imen ch commentedi tried on drupal 8.3.5 the token doesn't work even on role admin, the token has not been replaced
Comment #7
maaty388 commentedFor me token is not being replaced even for admin user
Comment #8
peter.draucbaher commentedHave to test with the updates.
Comment #11
peter.draucbaher commentedThis is a hard one... Any idea will be appreciated. Drupal uses caching... and request is even not initiatiated. Items cannot be replaced.
Had to dig deeper in the caching system to solve problems on front page for anonim user.
https://drupal.stackexchange.com/questions/201273/problem-with-event-sub...
It goes hand in hand with performance. It is a double edge sword... If caching is disabled performance will go to to he...
Comment #13
peter.draucbaher commentedWill have to solve the problem with cache context and BubbleableMetadata object (new BubbleableMetadata())->setCacheContexts(['bar']). This will be the most elegant way.
https://medium.com/@joshirohit100/cache-context-drupal-8-part-1-55303ec665ce
https://medium.com/@joshirohit100/cache-context-drupal-8-part-2-10088f67012e
https://www.youtube.com/watch?v=GSin_1jEyec
Comment #17
peter.draucbaher commentedTime for extensive testing.
Comment #19
peter.draucbaher commentedComment #20
peter.draucbaher commentedComment #22
reflie commentedHmm, seems that this issue isn't fixed. I can still reproduce it using latest module version (1.x-dev) and latest Drupal version (8.5.1).