Environment
- Drupal Version: 9.4.9
- Web Server: Apache/2.4.54 (Unix) LibreSSL/3.3.6
- PHP/7.4.33
- DatabaseVersion: 8.0.30
Problem/Motivation
Motivation: Update to latest recommended version.
Problem: after update to Recommended version:8.x-1.0-rc1 (2022-Nov-29), jump menu stopped working.
Steps to reproduce
1. Used composer to update Views Jump Menu
from8.x-1.0-beta3
to Recommended version:8.x-1.0-rc1 (2022-Nov-29)
2. Performed database update
----------------- ----------- --------------- -----------------------------
Module Update ID Type Description
----------------- ----------- --------------- -----------------------------
views_jump_menu 8101 hook_update_n 8101 - Adds the new_window
config key to existing jump
menu configurations.
----------------- ----------- --------------- -----------------------------
Do you wish to run the specified pending updates? (yes/no) [yes]:
> yes3. cleared cache
4. accessed page where views jump menu is located and perform a search.
*RESULT:* after entering a keyword in the search box, it stopped bringing back results after entering search term
Temp solution:
Rolling back changes to 8.x-1.0-beta3 made it work again.
*NOTE* after rolling back, performing a database update did not bring any change to the database
sudo drush updatedb
[success] No pending updates.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | views_jump_menu-back_to_jquery.patch | 781 bytes | sriharsha.uppuluri |
| #13 | views_jump_menu-back_to_jquery.patch | 881 bytes | fractile81 |
Issue fork views_jump_menu-3326071
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
la558 commentedComment #3
david.qdoscc commentedI'm experiencing the same issue. The search box filters the list correctly, but clicking on any of the results does not then jump to the selected page. I also reverted to 1.0-beta3 to get it working again.
Comment #4
la558 commentedHello,
Do you have any update on this issue?
Comment #5
jcnventuraThe bug reports seem to be about different problems. One being that search didn't return any results, the other in #3 that search did provide results but the redirect didn't happen.
To be honest, there's not enough information to know what exactly are the problems here. The module did change how it calculates where to jump to, and it is very possible that #3 was depending on the previous buggy functionality to work properly.
We need you to investigate the reason for the problem or provide a link to the site with the bug and document why it doesn't work, not simply that it doesn't work, as that is unfortunately not enough information.
Comment #6
la558 commentedthanks for your response.
As you can understand, I cannot push this change to our production site because because searching stopped working after applying this update.
Sorry, if I missed to provide further information.
What would you like me to add?
Screenshots?
Comment #7
la558 commentedAdding some screenshots and the JavaScript error.
*Behavior:*
1. enter the search term in the search box; as I'm typing in, possible matching results start coming up
2. select one among the different options
*on Views Jump Menu 8.x-1.0-beta3: everything works fine *
3. Content related to the selected entry is displayed.
*not working after running the update: 8.x-1.0-rc1*
3. nothing happens
*JavaScript error*
extract of JS code that it's referenced in the erro:
Line 5599 is
full function:
Comment #8
la558 commentedtried uploading images, but I'm not being able to do so.
Comment #9
la558 commented*NOTE*
could it be that the problem is that I'm using this module in conjunction with the chosen module?
Comment #10
david.qdoscc commentedIn my case, I am not using the Chosen module, but I am using Select2. If I uninstall Select2 the jump menu works, however we lose the search function which is a critical feature for us. So it may be that after 8.x-1.0-beta3 this module no longer works with Chosen or Select2?
I have also tested with the patch #22 from Integration with chosen or select2 js but it still doesn't work.
Comment #11
la558 commentedI've also tested it with the patch #22 from Integration with chosen or select2 without success.
Comment #12
jcnventuraYes, it seems clear to me that the selectedOptions array for change event listener on the .js-viewsJumpMenu selector is not set when using chosen or select2. This probably because those packages are changing that element in ways that I wasn't expecting it to change when testing this code. Maybe it is possible to narrow down the event listener to work only when selecting one option. Or maybe harden the code to skip the entire processing if selectedOptions is empty.
In any case, it seems that the module works fine with chosen or select2 even without the patch in #3077459: Integration with chosen or select2 js. If that is so, I wonder if it even makes any sense to keep that patch around.
Comment #13
fractile81 commentedIn my case, I have Chosen setup with a Views Jump Field element. I have found that changing the vanilla JS back to using jQuery fixed this particular issue. Not saying it's the direction to take it, just posting a work-around.
This is against RC1.
Comment #15
sriharsha.uppuluri commentedThank you for the patch; I've successfully ported it, and it's working for me.