There is an issue over in #1175260: Jump Menu requires unique paths which talks about a problem with Views not being able to include multiple items within a jump menu that point to the same URL. In that issue, there is a proposed solution which requires an adjustment to ctools to make it workable. Basically this checks the url to see if it is in a special format unique-id::url, and if so then it just uses the url part to perform the redirect. This allows one to include options like the following.

md5hash1:http://www.example.com/page
md5hash2:http://www.example.com/page
md5hash3:http://www.example.com/page

3 options that point to the same URL. ctools handles stripping out the prefix and ensuring that the correct URL is redirected to.

These is also a patch in the aforementioned Views issue which adds support for this new syntax to the views jump menu plugin.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrfelton’s picture

Status: Active » Needs review
FileSize
1.96 KB
merlinofchaos’s picture

Oh, this is a kind of a neat solution. I definitely hadn't considered anything like it!

merlinofchaos’s picture

Status: Needs review » Patch (to be ported)

Committed to D7. Doesn't apply cleanly to D6, needs a backport.

Note: The patch contained some whitespace that I fixed manually. They're hard to see, but luckily git warned me about them. Plus, there was a missing space after a ,

jrust’s picture

subscribe

jrust’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.8 KB

Backported for d6.

dagmar’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

It works fine. Apply the patch using -p1

monotaga’s picture

The patch in #5 works for me on D6, too. Can we get this committed? (Without this patch, jump menus in Views 6.x-3.x-dev don't work correctly unless if you modify views/plugins/views_plugin_style_jump_menu.inc.)

ktha’s picture

Status: Reviewed & tested by the community » Needs work

The patch #5 seems to be missing the following line at the end of ctools_jump_menu_submit():

$form_state['redirect'] = $redirect;
monotaga’s picture

ktha, I'm using the patch fine without that extra line. What's your use case that you're finding that line necessary? Want to submit an updated patch?

TimeBandit’s picture

FYI, this patch was NOT included in the recent (August 2012) 6x-1.9 update. Had to patch again on update. This patch does resolve the issue for me.

broncomania’s picture

I agree patch 5 works and is missing on the 6x-1.9 update. Please include this patch in the next version.

d.clarke’s picture

Status: Needs work » Needs review
FileSize
1.84 KB

Attached is a re-rolled patch that combines comment 5 and 8. The change from comment 8 was needed to fix the issue in my case and it makes sense since without it the ctools_jump_menu_submit() code is setting a variable that'll never get used.

TimeBandit’s picture

Patch works for me.
Note previous patch was not included in 2012-Nov-14 6.x-1.10 update.

merlinofchaos’s picture

TimeBandit: Yes, that's why the issue is marked 'needs review' and not 'fixed' or 'closed (fixed)'.

jelo’s picture

What is needed to get it committed? It appears that several community members have tested it and state that it works fine. Given that the views patch was committed in 2011 which adds the hash to the redirect URL, delays in committing this ctools patch actually break the whole style.

mikeker’s picture

Status: Needs review » Reviewed & tested by the community

Verified #12 works with Views 6.x-2.16. I would assume this works with the 3.x branch as well as it's client-side processing.

Just a note for those that don't read the entire issue, the path field needs to be rewritten in the form of some-unique-id::destination-path for this to work correctly.

Thanks, mrfelton!

mikeker’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.01 KB

Whoops... Take it back. I needed to add a decodeURIComponent() to make it work.

TimeBandit’s picture

Issue summary: View changes

Thanks for new patch. #17 works for me.

  • merlinofchaos committed f217719 on 8.x-2.x
    Issue #1224340: Allow multiple jump menu to same destination.
    
    

  • merlinofchaos committed f217719 on 8.x-3.x
    Issue #1224340: Allow multiple jump menu to same destination.