Closed (outdated)
Project:
Menu Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2011 at 21:58 UTC
Updated:
2 Dec 2021 at 05:02 UTC
Jump to comment: Most recent
Comments
Comment #1
dealancer commented"[current-user:field-herbid]/genealogia" should bring you to 'somewhere/genealogia' and not to 'somwgere_genealogia'so make sure you link is ok. I suggest you yo update link to "[current-user:field-herbid]_genealogia" and see what happens.
There is advice how to test your links. Change Title to "[current-user:field-herbid]/genealogia" and change path to or user and see what happens. Link title should contain url, check if it is correct.
Comment #3
raulmuroc commentedAgree it doesn't appear at all. Firstly I thougt it was because of menu_per_role menu, but I deactivated it, created another menu token link and nothing, it just doesn't appear at all.
Comment #4
raulmuroc commentedComment #5
raulmuroc commentedI beg your pardon I don't have time and it could be seen a little pretentious but I throw out a request for an active mantainer because it is not any movement in this module since february of 2011! 1 year!
Do you think it is a nice idea to open an issue for this request?
Comment #6
dealancer commentedNot sure why dev release is so old. I've made commits there a month ago, see http://drupalcode.org/project/menu_token.git/shortlog/refs/heads/7.x-1.x.
You could try to download dev release from drupalcode website.
I don't see reason why we could open the issue, unless you can provide steps how to reproduce it with a fresh d7 installation.
Please, write down steps I need to do, to reproduce it.
Thanks in advance.
Comment #7
raulmuroc commentedWell... at the "master" branch the last commit was in 25-02-2011: http://drupalcode.org/project/menu_token.git or http://drupalcode.org/project/menu_token.git/shortlog
The url which you talk about is another branch "heads", could be there the mistake? :S Trying to help ;) because it is really weird...
Appart from that I cannot download from there all package-in-one, I had to download separately and it broke my page, I had to put again the old version of 2011.
Thx in adv.
Comment #8
dealancer commentedWe are not using master branch now. The working branches are 6.x-1.x and 7.x-1.x.
Comment #9
dealancer commentedSee http://drupalcode.org/project/menu_token.git/shortlog/refs/heads/7.x-1.x
Comment #10
raulmuroc commentedI tried everything, but the problem is not solved. When using a Menu link with tokens, it just remains hide. I used in past menu per role and thought it was that, but i deleted it, uninstalled and tried menu token alone and the same results. :S
Perhaps... could you attach in this issue the last working Menu token module?
Comment #11
raulmuroc commentedI am trying to set a site with menu token, but I can't get the menu token to show up. I added a normal link in the menu and that link shows up fine. Basically the menu is not showing up at all. I tried changing the weights like was said in http://drupal.org/node/1138070 , and isolating menu token (so without menu_per_role) but didn't seem to work.
This a really important bug to solve because if not it doesn't have sense to install this module cuz menu just does not appears.
Working on it, but full of other modules bugs. Thanks for help!
Comment #12
raulmuroc commentedJust deleted menu per role and menu token and uninstalled from database. Then I Installed again with the following versions: Menu_token 7.x alpha3 and Menu_per_role 7.x-1.-x-dev. And it just worked.
There's nothing else to do, so solved.
Comment #14
ruess commentedSadly that fix did not work for me. This is a difficult problem for some reason, even with the latest build. One workaround that I'm having to use for now is to not use a relative path, but enter the link with the full http://mysite.com/[token]/blah as the path. It seems to ensure the menu item's appearance at least, though not the most preferable solutions for sure.
Comment #15
raulmuroc commentedYou are right #14ruess, to me worked for a while but now is again not working. I did your solution, to put absolute path instead of relative path and it works. So the problem is here with something related to paths...
Comment #16
dealancer commentedCould you please write steps to reproduce this issue?
Comment #17
raulmuroc commented1) Go to your menu
2) Add link
3) Introduce any link title
4) Introduce a relative path <-- here is the point, with an absolute path it works.
5) Thick "use tokens in title and path". The rest is the same either you fullfill or not.
That's it, when you fulfill with relative path it never shows up, when you do with absolute then it appears as expected.
Comment #18
karolrybak commentedI have a similiar problem to test it i created new site.
Then created 3 nodes in menu one under another like
1 > 2 > 3
Now I enter menu editing and check "use tokens" for node 3
(It is enough to enable the checkbox i'm not entering any tokens)
When i visit the node 3 menu is collapsed and active trail is not set.
When a normal menu item is below the menu item with token in menu structure active trail is set properly, however you cannot really access that node from menu, because node 2 will never get expanded if not set manually to do so.
I have setup a simple test site that shows the problem:
And a link to a node which is otherwise inaccesible from menu
http://testmenutoken.aspp.pl/node/6
Also, set_active_trail does not work on menu items with tokens enabled, so that might be the root of the problem, however i'm not experienced enough in drupal to dig into the core to pinpoint the problem.
I use latest stable ctools and token modules.
Same thing happens with stable and dev versions of menu token.
If you need more info let me know :)
Comment #19
mattdanger commentedVery that you have privileges to access the menu route you are trying to create using tokens.
Comment #20
karolrybak commentedI have no control access modules installed, also menu items do not have any replacement patterns defined so the path is not modified. Checking the checkbox is all that is reqiured to trigger this behaviour.
Comment #21
GeminiAgaloos commentedNote:
This issue also occurs in Menu Token 6.x-1.0-alpha2
Tested 27-June-2012
Steps to reproduce:
1) Go to your menu
2) Add a menu item
3) Title: Sample menu title
4) Path:
<front>(direct path to the front of page)5) save and view (menu item is showing up and works as expected)
Now, to introduce bug
6) go back to menu item and edit
7) Check "use tokens in title and path".
8) save and view... (menu item has disappeared)
Either of the following will make the menu item re-appear:
* edit the menu item and change the path from "
<front>" to "user"or
* simply uncheck the "use tokens in title and path"
Comment #22
tajindersingh commentedFacing same problem with 6.x-1.0-alpha2 as mentioned by 007g3m1n1
Tested some cases and found that in case of internal path, it is not being validated. So items disapper in case of invalid internal path. Also if path is set to <front>.
Below combinations can be tried for regeneration and verification:
1) Valid front path
Menu link title: Test Site
Path: [site-url]
Use tokens in title and in path: checked
Result: Link will appear
2) Valid front path with token in title
Menu link title: [site-name]
Path: [site-url]
Use tokens in title and in path: checked
Result: Link will appear
3) Token in title and external path
Menu link title: [site-name]
Path: http://www.google.com
Use tokens in title and in path: checked
Result: Link will appear
4) Token in title and any valid internal path
Menu link title: [site-name]
Path: user
Use tokens in title and in path: checked
Result: Link will not appear
5) Token in title and <front> as path
Menu link title: [site-name]
Path: <front>
Use tokens in title and in path: checked
Result: Link will not appear
6) Token in title and '/' as path, here '/' is an invalid path as internal paths don't lead by '/'
Menu link title: [site-name]
Path: /
Use tokens in title and in path: checked
Result: Link will not appear
7) Token in title and invalid internal path as lead by '/'
Menu link title: [site-name]
Path: /user
Use tokens in title and in path: checked
Result: Link will not appear
~~ Internal path Validation can be implemented by placing below lines at line 71 of menu_token.admin.inc ~~
$final_link['link_title'] = token_replace($form_state['values']['menu']['token']['link_title'], 'global');
$final_link['link_path'] = token_replace($form_state['values']['menu']['token']['link_path'], 'global');
if (!menu_valid_path($final_link)) {
form_set_error('link_path', t("The path '@link_path' is either invalid or you do not have access to it.", array('@link_path' => $form_state['values']['menu']['token']['link_path'])));
}
~~ Regarding <front> problem, not found a solution yet and currently using token [site-url] token ~~
Hope above helps :)
Comment #23
dalearyous commentedi am experiencing the same thing. i also notice that if you do get the link to show up, hover over the link to see token isn't being translated
Comment #24
DrupalDesigner-1 commentedI am also getting this. #17 is exactly what happens to me. Using Drupal 7.15
Comment #25
DrupalDesigner-1 commentedSolved this by typing in the absolute url instead of just the relative path.
Comment #26
reallyordinary commentedRunning into all the same issues experienced by above commenters. Except I can't get it working even with absolute URLs. Anytime I attempt to use tokens in any menu, the path for the menu item doesn't show up; just defaults back to the home page.
So... this module isn't working at all currently?
Comment #27
raulmuroc commentedAs said before: it works with absolute path. Missing patch for relative paths.
Comment #28
Sherbet commentedThis issue still exists in the 7.x-1.0-beta3 version. Any word on a patch?
Comment #29
develcuy commentedThanks for the report!
Comment #30
Sherbet commentedA temporary workaround for Drupal 7 is to use [site:url] to take into account the base path. I recommend using that until this is fixed.
A link to the user edit page would be [site:url]user/[current-user:uid]/edit for now.
Comment #31
dpatte commentedI was having a similar problem with 6.x-1.0-alpha2.
I have a menu and submenus that use the same token such as
team/[user-id]
team/[user-id]/accounts
team/[user-id]/contacts
I set the first menu to expanded, but sometimes the menu appeared collapsed and sometimes expanded
I switched the menus to
[site-url]team/[user-id]
[site-url]team/[user-id]/accounts
[site-url]team/[user-id]/contacts
and now the menu always appears expanded as expected
Comment #32
raulmuroc commentedNot critical. With an easy workaround which consistits of writting "Absolute URL's" instead of "Relative URL's" the problem gets solved.
No solution/working patch so far.
Comment #33
rickbcwt commentedI tried using [site:url]user/[current-user:uid]/edit AND my http:mysite.com/user/[current-user:uid]/edit with Version 7.x.1.0.beta4 and still no luck.
Comment #34
Sherbet commentedDoes it replace anything at all for you?
Comment #35
kingfisher64 commentedFinally after most of the day researching and trying out solutions including going through https://drupal.org/node/1117760 & https://drupal.org/node/2044945 the solution of using absolute paths instead of relatives worked.
Request
Can a note be made on project page that absolute URL's are needed at present. It might save someone else considerable time.
Thank you.
Comment #36
kingfisher64 commentedAlso beta 5 doesn't work but latest dev does so change of version is needed.
Comment #37
develcuy commented@kingfisher64, thanks for your feedback! did you tried beta5?
Comment #38
raulmuroc commented@develCuy, in his message, @kingfisher64 has explicitly written that
So if -dev version solves this problem this should be moved to a beta 6 version. But before move -dev to beta6 I recommend more testing in dev version and if it is solved then change status to fixed.
thanks!
Comment #39
develcuy commentedMissed his second comment, thanks @RaulMuroc!
Everyone: created a new issue related to it: [site-url] #2099623: When do you use [site-url] token?, your feedback is welcome!
Comment #40
akolahi commentedAn issue with using [site:url] is that it appears to bypass Drupal's check if the user has access of the link. Normally if a user does not have view rights, the link is not displayed.
Comment #41
alauddin commentedUsing 7.x-1.0-beta5 - Issue I had was menu was appearing for 'user1' but not for other roles
Tried +8-dev from 2015-Feb-20 with no luck.
Using absolute path worked for me in both beta5 and dev.
Note: the latest dev adds uuid module dependency, so be sure to enable that before the upgrade.
Just a fyi - When browsing through the token replacements.
The [current-page:arg:N] tokens have been renamed to [current-page:url:unaliased:args:value:N]
https://www.drupal.org/node/1265010
Comment #42
nDigitHQ commentedStill an issue. Was able to replicate via the steps above.
We were having problems with the [current-user:original:uid] portion which is key. I ended up writing a custom hook in my template.php file to handle the menu replacement. Here is the code:
In this case my menu name is dashboard. You'll want to replace that with whatever your menu name is.
Same thing goes for the themename_ piece. Change that to the name of your theme.
Hope this helps!
Comment #43
hcderaad commentedUnfortunately the workaround with an absolute path does not work if this absolute path is set through a Custom token, please also see: https://www.drupal.org/node/2687495
Comment #44
sarikak commentedMenus using tokens created with menu token module is now missing in the website. I am able to create new menus and these menus are visible in my website.
What should be the reason for missing the old menus? Whether it repeats again for the newly created menus?
Please provide a solution to this issues.
Thanks.
Comment #45
develcuy commented