Hello,

it seems the menu token doesn't support query string '?' in the url.

i attach a screenshot here, and the url in it retruns to be empty.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dealancer’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Priority: Normal » Major
psha’s picture

psha’s picture

Status: Active » Needs review
funkytraffic’s picture

+1
Same issue for the latest 6.x release. Will there be a change to the module?

Anonymous’s picture

Status: Needs review » Needs work

Patch from #2 does not work: it removes the ? and anything after it, instead of allowing to work with it.

dealancer’s picture

Here is a patch that should work. Please test it.

dealancer’s picture

Status: Needs work » Needs review
dealancer’s picture

Title: menu token doesn't support query string '?' in the url » menu token doesn't support query string ('?', '&') and fragnent ('#') in the url
dealancer’s picture

Title: menu token doesn't support query string ('?', '&') and fragnent ('#') in the url » menu token doesn't support query string ('?', '&') and fragment ('#') in the url
Liliplanet’s picture

Just discovered this module and without doubt the greatest thing since sliced bread!

Would love to be able to insert ? eg messages/new/[current-user:uid]?destination=user

Unfortunately patch outputs syntax error, unexpected $end in sites/all/modules/menu_token/menu_token.module on line 228

Most appreciated :)

noslokire’s picture

Status: Needs review » Needs work

Patch failed for me as well, adding the 2 missing curly brackets to the last line of the patch (lines 218 & 219) worked however.

Would pull down the dev version and patch myself but there looks to be a difference between dev and alpha versions

dealancer’s picture

yeah, this patch was for the dev version. Please try now.

noslokire’s picture

Good to go.

dealancer’s picture

Status: Needs work » Fixed

fixed!

dealancer’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Needs work

Now we need to backport this patch to 6.x-1.x.

lofos1’s picture

Version: 6.x-1.x-dev » 7.x-1.0-alpha3

I am using menu token, a custom created token ([current-user:og-uid]), organic groups and organic groups create permissions in D7. I noticed that the patch in #6 fixes the issue with menu token accepting query string, but it now creates a new issue for me.

A Site Admin who has create content permissions site-wide is able to see the Create content link with the token replaced www.yoursite.com/node/add/album?gids_group[]=[current-user:og-uid] , however an authenticated user who is also a group admin and has create content permissions within the group only but not site-wide cannot see the link. Before I applied the patch, both users could see the link, it just did not support the query strings.

I tried adjusting the module weight per the suggestion for a similar issue in http://drupal.org/node/1138070#comment-4534178 but this did not resolve the issue.

Any ideas what the problem might be? If you don't mind, it's fairly critical that I resolve this since it's delaying a site launch. Thanks a bunch :-)

lofos1’s picture

Per my post in #16, I also used the 7.x-1.0-beta1 version, but it is the same issue in beta.

I reverted to alpha3 because using the beta version created another issue for me because this patch http://drupal.org/node/1471730#comment-5700370, only removed the token from a menu I created, but not the entire menu link..... I had a menu www.yoursite.com/node/[current-user:og-nid] but if a user has not yet joined a group, then the token is replaced as www.yoursite.com/node instead of removing the entire menu link since it doesn't exist.

dealancer’s picture

Priority: Major » Normal

Re issue described in #17, you can create new issue that allows to hide menu link if token is not present. The purpose of #1471730: Option to clear token if replacement not present is a bit different.

Re issue #16, I am not sure how patch #6 can influence on permissions issue. It will help to understand the issue if you can debug menu_token. Could you please dpm (or print) generated link and access options before this lines:

http://drupalcode.org/project/menu_token.git/blob/refs/heads/7.x-1.x:/me...
http://drupalcode.org/project/menu_token.git/blob/refs/heads/7.x-1.x:/me...

windmaomao’s picture

Version: 7.x-1.0-alpha3 » 6.x-1.0-alpha2
Component: User interface » Code
Category: bug » support
Status: Needs work » Patch (to be ported)

anyone made the patch ported to 6.x yet ? I'll give a shot, but seems like there're many lines of change in code.

DevElCuy’s picture

Version: 6.x-1.0-alpha2 » 7.x-1.x-dev
Status: Patch (to be ported) » Needs review

D6 is discontinued.

DevElCuy’s picture

Status: Needs review » Fixed

Fix already committed.

Status: Fixed » Closed (fixed)

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

betz’s picture

Issue summary: View changes

It seems the D8 version neither supports query strings.