Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
A new release of the Drupal Chosen (7.x-2.0-alpha3) module is out, it is now using the new Chosen v1.0 jquery plugin which breaks the SHS Chosen functionality. Patch coming...
Comment | File | Size | Author |
---|---|---|---|
#34 | support_drupal_chosen-2084019-34.patch | 5.77 KB | markhalliwell |
Comments
Comment #1
jibize CreditAttribution: jibize commentedMaybe this would do it?
Comment #2
Redart CreditAttribution: Redart commentedIt doesn't work
Comment #3
alumni CreditAttribution: alumni commentedDoesn't work too
Comment #4
tamonten1 CreditAttribution: tamonten1 commentedDoesn't work too
Comment #5
OriginalSauce CreditAttribution: OriginalSauce commentedIs there a working patch for this?
If chosen is your chosen selector, this module no longer works correctly.
thanks.
Comment #6
idebr CreditAttribution: idebr commentedReroll of the patch in #1 plus some code standard fixes.
For the previous commenters: the patch has to be applied to the 7.x-1.x-dev release, since there have been quite a few changes since the latest recommended release.
Comment #7
mibfire CreditAttribution: mibfire commentedDoes this work? Cos it hasnt worked for me. I tryed on a profile2 form.
Comment #8
JadH CreditAttribution: JadH commentedI applied #6 on dev version and I can confirm it is working properly with chosen.
Comment #9
stBorchertThe semicolon is not needed here (see ajax.js for an example). If there are multiple functions in a behavior, there needs to be a comma.
Since its the only function the closing bracket is not followed by a semicolon or a comma.
This would break existing functionality of sites using the old plugin.
Both selectors need to be supported.
Same as above.
Is there any reason to extract all these settings into variables?
settings.chosen can be used directly instead of using "options".
Could you add some comments about the purpose of this and why SHS needs to do this?
Comment #10
stBorchertComment #11
MPeli CreditAttribution: MPeli commentedHello,
I created a block using Views Global Filter. The block contains a view with an exposed filter (Simple hierarchical select).
I also use Chosen 7.x-2.0-alpha4 and it seems that SHS and Chosen are not working together any more. Chosen is never applied on selects provided by SHS.
Is anyone facing the same problem?
Thank you, Martin.
Comment #12
revagomes CreditAttribution: revagomes commentedThe #6 patch didn't work to me using the latest version of chosen library (v1.1.0).
Here goes a screenshot after apllying the #6 and also a patch that fix this issue.
I've made some improvements and also added the @stBorchert's suggestions.
Comment #13
kungz13 CreditAttribution: kungz13 commentedIt doesn't work
Comment #14
j4 CreditAttribution: j4 commentedTried bith 6 and 12, both dont work for me..
Jaya
Comment #15
scottrigby#12 works perfectly with chosen 7.x-2.0-alpha4+7-dev and shs 7.x-1.6+34-dev, using the Chosen module recommended plugin version. The drush command 'chosenplugin' downloads Chosen library 1.0.0 (https://github.com/harvesthq/chosen/releases/download/1.0.0/chosen_v1.0....).
Comment #16
hauruck CreditAttribution: hauruck commented#12 does work a bit but it does not support the "add new item" option.
Would be great if someone could fix a better patch :-)
Comment #17
joelpittetBump, this works great nice work. The add new item works with what #15.
Yet I'm using chosen: 7.x-2.0-beta4 and shs 7.x-1.6+34-dev
Comment #18
joelpittetActually yeah, new items seem to still have an issue with this. Changing this back to needs work. as per #16.
And even some of the existing items don't work.
Comment #19
Lukas von BlarerI was unable to get the patch working. Has anyone solved this?
Comment #20
joelpittet@Lukas von Blarer I saddly just took the shs elements out of field groups for now. I've added
select:not(.shs-select):visible
to the chosen apply selectoron
admin/config/user-interface/chosen
Comment #21
ckaotikGot it working on my part with some changes, don't have a .patch for it though :/
- using shs-7.x-1.6+54-dev
- using chosen-7.x-2.0-beta4
- using chosen.js v1.1.0
I've disabled Chosen on my specific element, via either @joelpittet's #20 or configuring my views filter to "never" use Chosen. Then I only needed these changes to shs/js/shs.js:
1. Completely replaced the `elementConvertToChosen` function. This will properly initialize Chosen on the newly created <select> object.
2. Replaced `_chzn' with '_chosen' in `updateElements`(line 299 & line 318). This will allow for clean removing of previously created Chosen elements.
Comment #22
guillaumev CreditAttribution: guillaumev commentedRerolling #12 for new dev version of shs
Comment #23
guillaumev CreditAttribution: guillaumev commentedSorry forgot to attach...
Comment #24
joelpittetComment #25
pookmish CreditAttribution: pookmish commentedUsing a SHS in exposed filter on view, #23 helped clean it up, but no options are created in the chosen dropdown.
Comment #26
joelpittet@guillaumev awesome, that works with and without a fieldgroup! Thank you
Comment #27
joelpittet@pookmish that may be another issue?
Comment #28
joelpittetFYI using Chosen v1.3.0 and chosen module 7.x-2.0-beta4 and shs 7.x-1.6+56-dev
Comment #29
Drupa1ish CreditAttribution: Drupa1ish at EuroDomenii commented#23 works for me too. Thx @guillaumev
Chosen library v1.4.2 + chosen module 7.x-2.0-beta4 + shs 7.x-1.6+58-dev
Comment #30
Drupa1ish CreditAttribution: Drupa1ish at EuroDomenii commented#23 works, but trying to create items at deeper level, always ends creating the taxonomy item at first level in back-end.
Anyone else has experienced this before?
Comment #31
asghar CreditAttribution: asghar commentedYou can use https://www.drupal.org/project/term_hierarchy module and chosen module.
Comment #32
joelpittetWith the latest changes this no longer applies. I wonder if the changes can be simplified to avoid the large hunk change?
Comment #33
joelpittetThis patch did seem to fix SHS inside a hidden vertical tab and loading from there it seems. I tried merging but didn't get too far due to the changes in the JS file
Comment #34
markhalliwellRe-roll + a little cleanup with variable declarations/names.
Comment #35
stBorchertA quick question without having a deeper look onto the patch (and without testing):
What does
void 0
do? I've never seen this before.Comment #36
markhalliwellI'm not going to play issue status ping pong, but I would consider this a major bug since the stable (and only) release for the Chosen module is the 7.x-2.x branch (major) and the current chosen implementation in this module does absolutely nothing (bug).
This is the easiest (and shortest) way to check if a variable is undefined. See: http://stackoverflow.com/a/7452352/1226717
Comment #38
stBorchertThanks for the work and your patience ;). I've committed the integration for Chosen 2.x.
Chosen 7.x-1.x (and thus Chosen library <1.1.0) is not supported by SHS anymore.